mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
darwinssl: fix certificate verification disable on OS X 10.8
The new way of disabling certificate verification doesn't work on Mountain Lion (OS X 10.8) so we need to use the old way in that version too. I've tested this solution on versions 10.7.5, 10.8, 10.9, 10.10.2 and 10.11. Closes #802
This commit is contained in:
parent
0761a51ee0
commit
3cf339901e
@ -1281,14 +1281,21 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
|||||||
#if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS
|
#if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS
|
||||||
/* Snow Leopard introduced the SSLSetSessionOption() function, but due to
|
/* Snow Leopard introduced the SSLSetSessionOption() function, but due to
|
||||||
a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag
|
a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag
|
||||||
works, it doesn't work as expected under Snow Leopard or Lion.
|
works, it doesn't work as expected under Snow Leopard, Lion or
|
||||||
|
Mountain Lion.
|
||||||
So we need to call SSLSetEnableCertVerify() on those older cats in order
|
So we need to call SSLSetEnableCertVerify() on those older cats in order
|
||||||
to disable certificate validation if the user turned that off.
|
to disable certificate validation if the user turned that off.
|
||||||
(SecureTransport will always validate the certificate chain by
|
(SecureTransport will always validate the certificate chain by
|
||||||
default.) */
|
default.)
|
||||||
/* (Note: Darwin 12.x.x is Mountain Lion.) */
|
Note:
|
||||||
|
Darwin 11.x.x is Lion (10.7)
|
||||||
|
Darwin 12.x.x is Mountain Lion (10.8)
|
||||||
|
Darwin 13.x.x is Maverik (10.9)
|
||||||
|
Darwin 14.x.x is Yosemite (10.10)
|
||||||
|
Darwin 15.x.x is El Capitan (10.11)
|
||||||
|
*/
|
||||||
#if CURL_BUILD_MAC
|
#if CURL_BUILD_MAC
|
||||||
if(SSLSetSessionOption != NULL && darwinver_maj >= 12) {
|
if(SSLSetSessionOption != NULL && darwinver_maj >= 13) {
|
||||||
#else
|
#else
|
||||||
if(SSLSetSessionOption != NULL) {
|
if(SSLSetSessionOption != NULL) {
|
||||||
#endif /* CURL_BUILD_MAC */
|
#endif /* CURL_BUILD_MAC */
|
||||||
|
Loading…
Reference in New Issue
Block a user