Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/XmppClient.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | XmppClient::XmppClient(const std::string& sUsername, const std::string& sPassword, const std::string& sRoom, const std::string& sNick, const int historyRequestSize, bool regOpt) | ||||
// If we are registering, only use the server name | // If we are registering, only use the server name | ||||
if (!regOpt) | if (!regOpt) | ||||
m_client = new glooxwrapper::Client(clientJid, sPassword); | m_client = new glooxwrapper::Client(clientJid, sPassword); | ||||
else | else | ||||
m_client = new glooxwrapper::Client(m_server); | m_client = new glooxwrapper::Client(m_server); | ||||
// Optionally join without a TLS certificate, so a local server can be tested quickly. | // Optionally join without a TLS certificate, so a local server can be tested quickly. | ||||
// Security risks from malicious JS mods can be mitigated if this option and also the hostname and login are shielded from JS access. | // Security risks from malicious JS mods can be mitigated if this option and also the hostname and login are shielded from JS access. | ||||
bool require_tls = true; | bool tls = true; | ||||
CFG_GET_VAL("lobby.require_tls", require_tls); | CFG_GET_VAL("lobby.tls", tls); | ||||
m_client->setTls(require_tls ? gloox::TLSRequired : gloox::TLSOptional); | m_client->setTls(tls ? gloox::TLSRequired : gloox::TLSDisabled); | ||||
// Disable use of the SASL PLAIN mechanism, to prevent leaking credentials | // Disable use of the SASL PLAIN mechanism, to prevent leaking credentials | ||||
// if the server doesn't list any supported SASL mechanism or the response | // if the server doesn't list any supported SASL mechanism or the response | ||||
// has been modified to exclude those. | // has been modified to exclude those. | ||||
const int mechs = gloox::SaslMechAll ^ gloox::SaslMechPlain; | const int mechs = gloox::SaslMechAll ^ gloox::SaslMechPlain; | ||||
m_client->setSASLMechanisms(mechs); | m_client->setSASLMechanisms(mechs); | ||||
m_client->registerConnectionListener(this); | m_client->registerConnectionListener(this); | ||||
▲ Show 20 Lines • Show All 1,123 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator