diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-01-11 21:55:52 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-01-11 21:55:52 -0500 |
| commit | 8a2e023e28dd546641571dd24be721397c9ee9e1 (patch) | |
| tree | a8b086e4bf154636393b76481150fc84fc3c21fc /MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs | |
| parent | ba4ca10ae29a50ed452ed3d05f885b3fa81595e2 (diff) | |
| parent | 355edfa2020d19b0fba6b09da40de4e66395d4b7 (diff) | |
Merge branch 'dev'
Conflicts:
MediaBrowser.Controller/Entities/BaseItem.cs
MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-apiclient/.bower.json
MediaBrowser.WebDashboard/dashboard-ui/bower_components/emby-webcomponents/.bower.json
MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-icons/.bower.json
MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-icons/bower.json
MediaBrowser.WebDashboard/dashboard-ui/strings/html/kk.json
MediaBrowser.WebDashboard/dashboard-ui/strings/html/ru.json
MediaBrowser.WebDashboard/dashboard-ui/strings/javascript/kk.json
MediaBrowser.WebDashboard/dashboard-ui/strings/javascript/ru.json
SharedVersion.cs
Diffstat (limited to 'MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs index a7d3854e7..2f4c3f5ee 100644 --- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -171,12 +171,36 @@ namespace MediaBrowser.Server.Implementations.Configuration ValidateItemByNamePath(newConfig); ValidatePathSubstitutions(newConfig); ValidateMetadataPath(newConfig); + ValidateSslCertificate(newConfig); EventHelper.FireEventIfNotNull(ConfigurationUpdating, this, new GenericEventArgs<ServerConfiguration> { Argument = newConfig }, Logger); base.ReplaceConfiguration(newConfiguration); } + + /// <summary> + /// Validates the SSL certificate. + /// </summary> + /// <param name="newConfig">The new configuration.</param> + /// <exception cref="System.IO.DirectoryNotFoundException"></exception> + private void ValidateSslCertificate(BaseApplicationConfiguration newConfig) + { + var serverConfig = (ServerConfiguration)newConfig; + + var newPath = serverConfig.CertificatePath; + + if (!string.IsNullOrWhiteSpace(newPath) + && !string.Equals(Configuration.CertificatePath ?? string.Empty, newPath)) + { + // Validate + if (!FileSystem.FileExists(newPath)) + { + throw new FileNotFoundException(string.Format("Certificate file '{0}' does not exist.", newPath)); + } + } + } + private void ValidatePathSubstitutions(ServerConfiguration newConfig) { foreach (var map in newConfig.PathSubstitutions) |
