Turn on SNI in OpenSSL
This commit is contained in:
parent
119cd5d3ff
commit
f56a0435f2
1 changed files with 7 additions and 0 deletions
|
@ -309,6 +309,9 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs,
|
||||||
validate_certs=p_validate_certs;
|
validate_certs=p_validate_certs;
|
||||||
validate_hostname=p_for_hostname!="";
|
validate_hostname=p_for_hostname!="";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (p_validate_certs) {
|
if (p_validate_certs) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -380,6 +383,10 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs,
|
||||||
bio->ptr = this;
|
bio->ptr = this;
|
||||||
SSL_set_bio( ssl, bio, bio );
|
SSL_set_bio( ssl, bio, bio );
|
||||||
|
|
||||||
|
if (p_for_hostname!=String()) {
|
||||||
|
SSL_set_tlsext_host_name(ssl,p_for_hostname.utf8().get_data());
|
||||||
|
}
|
||||||
|
|
||||||
use_blocking=true; // let handshake use blocking
|
use_blocking=true; // let handshake use blocking
|
||||||
// Set the SSL to automatically retry on failure.
|
// Set the SSL to automatically retry on failure.
|
||||||
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
|
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
|
||||||
|
|
Loading…
Reference in a new issue