diff options
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 13 | ||||
-rwxr-xr-x | system/settings/settings.xml | 8 | ||||
-rw-r--r-- | xbmc/network/NetworkServices.cpp | 3 | ||||
-rw-r--r-- | xbmc/network/WebServer.cpp | 5 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 2 | ||||
-rw-r--r-- | xbmc/settings/Settings.h | 1 |
6 files changed, 28 insertions, 4 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index a9b75d45f5..fface7083f 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -3253,7 +3253,10 @@ msgctxt "#728" msgid "FTP server" msgstr "" -#empty string with id 729 +#: system/settings/settings.xml +msgctxt "#729" +msgid "Enable SSL" +msgstr "" #: system/settings/settings.xml msgctxt "#730" @@ -20400,7 +20403,13 @@ msgctxt "#36627" msgid "Client" msgstr "" -#empty strings from id 36628 to 36899 +#empty strings from id 36628 to 36898 + +#. Description of setting with label #729 "Enable SSL" +#: system/settings/settings.xml +msgctxt "#36899" +msgid "Enables SSL encryption in the webserver. Certificate special://userdata/server.key and Key special://userdata/server.pem must be created manually" +msgstr "" #: xbmc/media/MediaType.cpp msgctxt "#36900" diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 0c65d8406b..73c4272b49 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -1758,6 +1758,14 @@ <hidden>true</hidden> </control> </setting> + <setting id="services.webserverssl" type="boolean" parent="services.webserver" label="729" help="36899"> + <level>1</level> + <default>false</default> + <dependencies> + <dependency type="enable" setting="services.webserver">true</dependency> + </dependencies> + <control type="toggle" /> + </setting> <setting id="services.webskin" type="addon" label="199" help="36332"> <level>1</level> <default>webinterface.default</default> diff --git a/xbmc/network/NetworkServices.cpp b/xbmc/network/NetworkServices.cpp index 90ed446d7b..429be88779 100644 --- a/xbmc/network/NetworkServices.cpp +++ b/xbmc/network/NetworkServices.cpp @@ -160,7 +160,8 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting const std::string &settingId = setting->GetId(); #ifdef HAS_WEB_SERVER if (settingId == CSettings::SETTING_SERVICES_WEBSERVER || - settingId == CSettings::SETTING_SERVICES_WEBSERVERPORT) + settingId == CSettings::SETTING_SERVICES_WEBSERVERPORT || + settingId == CSettings::SETTING_SERVICES_WEBSERVERSSL) { if (IsWebserverRunning() && !StopWebserver()) return false; diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp index 4db650bf2f..fe352ddf75 100644 --- a/xbmc/network/WebServer.cpp +++ b/xbmc/network/WebServer.cpp @@ -35,6 +35,7 @@ #include "network/httprequesthandler/IHTTPRequestHandler.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" +#include "ServiceBroker.h" #include "threads/SingleLock.h" #include "URL.h" #include "Util.h" @@ -1157,7 +1158,9 @@ struct MHD_Daemon* CWebServer::StartMHD(unsigned int flags, int port) MHD_set_panic_func(&panicHandlerForMHD, nullptr); #endif - if (LoadCert(m_key, m_cert) && MHD_is_feature_supported(MHD_FEATURE_SSL) == MHD_YES) + if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_SERVICES_WEBSERVERSSL) && + MHD_is_feature_supported(MHD_FEATURE_SSL) == MHD_YES && + LoadCert(m_key, m_cert)) // SSL enabled return MHD_start_daemon(flags | #if (MHD_VERSION >= 0x00040002) && (MHD_VERSION < 0x00090B01) diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index b5add4c8ef..7fa4946741 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -325,6 +325,7 @@ const std::string CSettings::SETTING_SERVICES_WEBSERVER = "services.webserver"; const std::string CSettings::SETTING_SERVICES_WEBSERVERPORT = "services.webserverport"; const std::string CSettings::SETTING_SERVICES_WEBSERVERUSERNAME = "services.webserverusername"; const std::string CSettings::SETTING_SERVICES_WEBSERVERPASSWORD = "services.webserverpassword"; +const std::string CSettings::SETTING_SERVICES_WEBSERVERSSL = "services.webserverssl"; const std::string CSettings::SETTING_SERVICES_WEBSKIN = "services.webskin"; const std::string CSettings::SETTING_SERVICES_ESENABLED = "services.esenabled"; const std::string CSettings::SETTING_SERVICES_ESPORT = "services.esport"; @@ -976,6 +977,7 @@ void CSettings::InitializeISettingCallbacks() settingSet.insert(CSettings::SETTING_SERVICES_WEBSERVERPORT); settingSet.insert(CSettings::SETTING_SERVICES_WEBSERVERUSERNAME); settingSet.insert(CSettings::SETTING_SERVICES_WEBSERVERPASSWORD); + settingSet.insert(CSettings::SETTING_SERVICES_WEBSERVERSSL); settingSet.insert(CSettings::SETTING_SERVICES_ZEROCONF); settingSet.insert(CSettings::SETTING_SERVICES_AIRPLAY); settingSet.insert(CSettings::SETTING_SERVICES_AIRPLAYVOLUMECONTROL); diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 6f05379cc3..bdeb0ebd3f 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -272,6 +272,7 @@ public: static const std::string SETTING_SERVICES_WEBSERVERPORT; static const std::string SETTING_SERVICES_WEBSERVERUSERNAME; static const std::string SETTING_SERVICES_WEBSERVERPASSWORD; + static const std::string SETTING_SERVICES_WEBSERVERSSL; static const std::string SETTING_SERVICES_WEBSKIN; static const std::string SETTING_SERVICES_ESENABLED; static const std::string SETTING_SERVICES_ESPORT; |