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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user