SNI not provided when allow_invalid_hostname is set
@@ -560,9 +560,7 @@ mongoc_stream_tls_openssl_handshake (mongoc_stream_t *stream,
/* Added in OpenSSL 0.9.8f, as a build time option */
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
/* Set the SNI hostname we are expecting certificate for */
- if (!tls->ssl_opts.allow_invalid_hostname) {
SSL_set_tlsext_host_name (ssl, host);
- }
#endif
if (BIO_do_handshake (openssl->bio) == 1) {
