Add support for client-side SNI

This commit is contained in:
Jonathan Schleifer 2018-02-25 21:26:30 +01:00
parent 8e0deb6a64
commit 3b702e2cb6
No known key found for this signature in database
GPG key ID: 28D65178B37F33E3
2 changed files with 12 additions and 1 deletions

View file

@ -199,6 +199,17 @@ locking_callback(int mode, int n, const char *file, int line)
SSLError: error];
}
if (SSL_set_tlsext_host_name(_SSL, [host UTF8String]) != 1) {
unsigned long error = ERR_get_error();
[self close];
@throw [SSLConnectionFailedException exceptionWithHost: host
port: port
socket: self
SSLError: error];
}
if (_certificateVerificationEnabled) {
X509_VERIFY_PARAM *param = SSL_get0_param(_SSL);