Commit 6ba731c5 authored by Tristan Matthews's avatar Tristan Matthews

* #38285: sipaccount: tlsEnable should be a boolean, not a string

parent 724ed9f0
...@@ -99,7 +99,7 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled) ...@@ -99,7 +99,7 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled)
, stunServerName_() , stunServerName_()
, stunPort_(PJ_STUN_PORT) , stunPort_(PJ_STUN_PORT)
, dtmfType_(OVERRTP_STR) , dtmfType_(OVERRTP_STR)
, tlsEnable_(Conf::FALSE_STR) , tlsEnable_(false)
, tlsCaListFile_() , tlsCaListFile_()
, tlsCertificateFile_() , tlsCertificateFile_()
, tlsPrivateKeyFile_() , tlsPrivateKeyFile_()
...@@ -710,8 +710,8 @@ void SIPAccount::setAccountDetails(const std::map<std::string, std::string> &det ...@@ -710,8 +710,8 @@ void SIPAccount::setAccountDetails(const std::map<std::string, std::string> &det
validate(srtpKeyExchange_, iter->second, VALID_SRTP_KEY_EXCHANGES); validate(srtpKeyExchange_, iter->second, VALID_SRTP_KEY_EXCHANGES);
// TLS settings // TLS settings
parseBool(details, CONFIG_TLS_ENABLE, tlsEnable_);
parseInt(details, CONFIG_TLS_LISTENER_PORT, tlsListenerPort_); parseInt(details, CONFIG_TLS_LISTENER_PORT, tlsListenerPort_);
parseString(details, CONFIG_TLS_ENABLE, tlsEnable_);
parseString(details, CONFIG_TLS_CA_LIST_FILE, tlsCaListFile_); parseString(details, CONFIG_TLS_CA_LIST_FILE, tlsCaListFile_);
parseString(details, CONFIG_TLS_CERTIFICATE_FILE, tlsCertificateFile_); parseString(details, CONFIG_TLS_CERTIFICATE_FILE, tlsCertificateFile_);
parseString(details, CONFIG_TLS_PRIVATE_KEY_FILE, tlsPrivateKeyFile_); parseString(details, CONFIG_TLS_PRIVATE_KEY_FILE, tlsPrivateKeyFile_);
...@@ -865,7 +865,7 @@ std::map<std::string, std::string> SIPAccount::getAccountDetails() const ...@@ -865,7 +865,7 @@ std::map<std::string, std::string> SIPAccount::getAccountDetails() const
std::stringstream tlslistenerport; std::stringstream tlslistenerport;
tlslistenerport << tlsListenerPort_; tlslistenerport << tlsListenerPort_;
a[CONFIG_TLS_LISTENER_PORT] = tlslistenerport.str(); a[CONFIG_TLS_LISTENER_PORT] = tlslistenerport.str();
a[CONFIG_TLS_ENABLE] = tlsEnable_; a[CONFIG_TLS_ENABLE] = tlsEnable_ ? Conf::TRUE_STR : Conf::FALSE_STR;
a[CONFIG_TLS_CA_LIST_FILE] = tlsCaListFile_; a[CONFIG_TLS_CA_LIST_FILE] = tlsCaListFile_;
a[CONFIG_TLS_CERTIFICATE_FILE] = tlsCertificateFile_; a[CONFIG_TLS_CERTIFICATE_FILE] = tlsCertificateFile_;
a[CONFIG_TLS_PRIVATE_KEY_FILE] = tlsPrivateKeyFile_; a[CONFIG_TLS_PRIVATE_KEY_FILE] = tlsPrivateKeyFile_;
...@@ -890,7 +890,7 @@ void SIPAccount::registerVoIPLink() ...@@ -890,7 +890,7 @@ void SIPAccount::registerVoIPLink()
#if HAVE_TLS #if HAVE_TLS
// Init TLS settings if the user wants to use TLS // Init TLS settings if the user wants to use TLS
if (tlsEnable_ == Conf::TRUE_STR) { if (tlsEnable_) {
DEBUG("TLS is enabled for account %s", accountID_.c_str()); DEBUG("TLS is enabled for account %s", accountID_.c_str());
transportType_ = PJSIP_TRANSPORT_TLS; transportType_ = PJSIP_TRANSPORT_TLS;
initTlsConfiguration(); initTlsConfiguration();
...@@ -1088,7 +1088,7 @@ void SIPAccount::loadConfig() ...@@ -1088,7 +1088,7 @@ void SIPAccount::loadConfig()
#if HAVE_TLS #if HAVE_TLS
if (tlsEnable_ == Conf::TRUE_STR) { if (tlsEnable_) {
initTlsConfiguration(); initTlsConfiguration();
transportType_ = PJSIP_TRANSPORT_TLS; transportType_ = PJSIP_TRANSPORT_TLS;
} else } else
...@@ -1455,7 +1455,7 @@ std::map<std::string, std::string> SIPAccount::getTlsSettings() const ...@@ -1455,7 +1455,7 @@ std::map<std::string, std::string> SIPAccount::getTlsSettings() const
std::stringstream portstr; std::stringstream portstr;
portstr << tlsListenerPort_; portstr << tlsListenerPort_;
tlsSettings[CONFIG_TLS_LISTENER_PORT] = portstr.str(); tlsSettings[CONFIG_TLS_LISTENER_PORT] = portstr.str();
tlsSettings[CONFIG_TLS_ENABLE] = tlsEnable_; tlsSettings[CONFIG_TLS_ENABLE] = tlsEnable_ ? Conf::TRUE_STR : Conf::FALSE_STR;
tlsSettings[CONFIG_TLS_CA_LIST_FILE] = tlsCaListFile_; tlsSettings[CONFIG_TLS_CA_LIST_FILE] = tlsCaListFile_;
tlsSettings[CONFIG_TLS_CERTIFICATE_FILE] = tlsCertificateFile_; tlsSettings[CONFIG_TLS_CERTIFICATE_FILE] = tlsCertificateFile_;
tlsSettings[CONFIG_TLS_PRIVATE_KEY_FILE] = tlsPrivateKeyFile_; tlsSettings[CONFIG_TLS_PRIVATE_KEY_FILE] = tlsPrivateKeyFile_;
......
...@@ -727,9 +727,8 @@ class SIPAccount : public Account { ...@@ -727,9 +727,8 @@ class SIPAccount : public Account {
/** /**
* Determine if TLS is enabled for this account. TLS provides a secured channel for * Determine if TLS is enabled for this account. TLS provides a secured channel for
* SIP signalization. It is independant than the media encription provided by SRTP or ZRTP. * SIP signalization. It is independant than the media encription provided by SRTP or ZRTP.
* FIXME: this should be a bool
*/ */
std::string tlsEnable_; bool tlsEnable_;
/** /**
* Certificate autority file * Certificate autority file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment