Fixed daemon support over HTTPS.
This commit is contained in:
parent
62012a1a50
commit
5e369a5af8
6 changed files with 90 additions and 24 deletions
|
@ -72,19 +72,11 @@ bool xmrig::DaemonClient::disconnect()
|
|||
|
||||
bool xmrig::DaemonClient::isTLS() const
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
return m_pool.isTLS();
|
||||
# else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char *xmrig::DaemonClient::tlsFingerprint() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
const char *xmrig::DaemonClient::tlsVersion() const
|
||||
{
|
||||
return nullptr;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -145,6 +137,11 @@ void xmrig::DaemonClient::onHttpData(const HttpData &data)
|
|||
|
||||
m_ip = static_cast<const HttpContext &>(data).ip().c_str();
|
||||
|
||||
if (isTLS()) {
|
||||
m_tlsVersion = static_cast<const HttpsClient &>(data).version();
|
||||
m_tlsFingerprint = static_cast<const HttpsClient &>(data).fingerprint();
|
||||
}
|
||||
|
||||
rapidjson::Document doc;
|
||||
if (doc.Parse(data.body.c_str()).HasParseError()) {
|
||||
if (!isQuiet()) {
|
||||
|
@ -294,7 +291,7 @@ void xmrig::DaemonClient::send(int method, const char *url, const char *data, si
|
|||
HttpClient *client;
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
if (m_pool.isTLS()) {
|
||||
client = new HttpsClient(method, url, this, data, size);
|
||||
client = new HttpsClient(method, url, this, data, size, m_pool.fingerprint());
|
||||
}
|
||||
else
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue