Use peerName instead of peerAddress
This commit is contained in:
parent
39ece29fed
commit
893726c3d8
@ -317,9 +317,9 @@ void TLSSocket_GnuTLS::handshake() {
|
||||
|
||||
// Start handshaking process
|
||||
try {
|
||||
string peerAddress = getPeerAddress();
|
||||
string peerName = getPeerName();
|
||||
|
||||
gnutls_server_name_set(*m_session->m_gnutlsSession, GNUTLS_NAME_DNS, peerAddress.c_str(), peerAddress.size());
|
||||
gnutls_server_name_set(*m_session->m_gnutlsSession, GNUTLS_NAME_DNS, peerName.c_str(), peerName.size());
|
||||
|
||||
while (true) {
|
||||
|
||||
|
@ -122,9 +122,9 @@ TLSSocket_OpenSSL::~TLSSocket_OpenSSL() {
|
||||
void TLSSocket_OpenSSL::createSSLHandle() {
|
||||
|
||||
if (m_wrapped->isConnected()) {
|
||||
string peerAddress = getPeerAddress();
|
||||
string peerName = getPeerName();
|
||||
|
||||
if (peerAddress.empty()) {
|
||||
if (peerName.empty()) {
|
||||
throw exceptions::tls_exception("Unknown host name, will not be able to set SNI");
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ void TLSSocket_OpenSSL::createSSLHandle() {
|
||||
}
|
||||
|
||||
SSL_set_bio(m_ssl, sockBio, sockBio);
|
||||
SSL_set_tlsext_host_name(m_ssl, peerAddress.c_str());
|
||||
SSL_set_tlsext_host_name(m_ssl, peerName.c_str());
|
||||
SSL_set_connect_state(m_ssl);
|
||||
SSL_set_mode(m_ssl, SSL_MODE_AUTO_RETRY | SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user