Added SSL/TLS support to stratum communication

This commit is contained in:
BenDroid 2018-02-25 22:06:40 +01:00
parent d6f27624b7
commit b5cba7bf57
8 changed files with 139 additions and 270 deletions

View file

@ -49,7 +49,11 @@ DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) :
keccak(reinterpret_cast<const uint8_t *>(user), static_cast<int>(strlen(user)), hash, sizeof(hash));
Job::toHex(hash, 32, userId);
Url *url = new Url("donate.graef.in", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 80 : 443, userId, nullptr, false, true);
#ifndef XMRIG_NO_SSL_TLS
Url *url = new Url("donate.graef.in", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 8080 : 8081, userId, nullptr, true, false, true);
#else
Url *url = new Url("donate.graef.in", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 80 : 443, userId, nullptr, false, false, true);
#endif
m_client = new Client(-1, agent, this);
m_client->setUrl(url);