1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-12 01:42:48 -05:00

Added SNI option for TLS connections

Disabled by default, add `"sni": true,` to pool config to enable it.
This commit is contained in:
SChernykh
2023-09-29 08:33:01 +02:00
parent e855723cd9
commit 0a3313cb76
5 changed files with 13 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ xmrig::Client::Tls::~Tls()
}
bool xmrig::Client::Tls::handshake()
bool xmrig::Client::Tls::handshake(const char* servername)
{
m_ssl = SSL_new(m_ctx);
assert(m_ssl != nullptr);
@@ -69,6 +69,10 @@ bool xmrig::Client::Tls::handshake()
return false;
}
if (servername) {
SSL_set_tlsext_host_name(m_ssl, servername);
}
SSL_set_connect_state(m_ssl);
SSL_set_bio(m_ssl, m_read, m_write);
SSL_do_handshake(m_ssl);