On Darwin SSL, add ability to skip peer verification.

This commit is contained in:
Benjamin Sergeant 2019-11-20 13:58:08 -08:00
parent a7df6120d5
commit 6808a0b500
4 changed files with 31 additions and 5 deletions

View File

@ -1 +1 @@
7.3.4 7.3.5

View File

@ -1,6 +1,10 @@
# Changelog # Changelog
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [7.3.5] - 2019-11-20
- On Darwin SSL, add ability to skip peer verification.
## [7.3.4] - 2019-11-20 ## [7.3.4] - 2019-11-20
- 32-bits compile fix, courtesy of @fcojavmc - 32-bits compile fix, courtesy of @fcojavmc

View File

@ -168,10 +168,32 @@ namespace ix
SSLSetProtocolVersionMin(_sslContext, kTLSProtocol12); SSLSetProtocolVersionMin(_sslContext, kTLSProtocol12);
SSLSetPeerDomainName(_sslContext, host.c_str(), host.size()); SSLSetPeerDomainName(_sslContext, host.c_str(), host.size());
do if (_tlsOptions.isPeerVerifyDisabled())
{ {
status = SSLHandshake(_sslContext); Boolean option(1);
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status); SSLSetSessionOption(_sslContext, kSSLSessionOptionBreakOnServerAuth, option);
do
{
status = SSLHandshake(_sslContext);
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
if (status == errSSLServerAuthCompleted)
{
// proceed with the handshake
do
{
status = SSLHandshake(_sslContext);
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
}
}
else
{
do
{
status = SSLHandshake(_sslContext);
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
}
} }
if (noErr != status) if (noErr != status)

View File

@ -6,4 +6,4 @@
#pragma once #pragma once
#define IX_WEBSOCKET_VERSION "7.3.4" #define IX_WEBSOCKET_VERSION "7.3.5"