示例#1
0
        public CentralSsl(ILogService log, CentralSslOptions options)
        {
            _log = log;

            if (!string.IsNullOrWhiteSpace(options.PfxPassword))
            {
                _password = options.PfxPassword;
            }
            else
            {
                _password = Settings.Default.DefaultCentralSslPfxPassword;
            }

            if (!string.IsNullOrWhiteSpace(options.Path))
            {
                _path = options.Path;
            }
            else
            {
                _path = Settings.Default.DefaultCentralSslStore;
            }
            if (_path.ValidPath(log))
            {
                _log.Debug("Using Centralized SSL path: {_path}", _path);
            }
            else
            {
                throw new Exception("Error initializing CentralSsl plugin, specified path is not valid.");
            }
        }
示例#2
0
        public CentralSsl(
            ILogService log,
            ISettingsService settings,
            CentralSslOptions options,
            SecretServiceManager secretServiceManager)
        {
            _log = log;

            var passwordRaw = !string.IsNullOrWhiteSpace(options.PfxPassword?.Value) ?
                              options.PfxPassword.Value :
                              settings.Store.CentralSsl.DefaultPassword;

            _password = secretServiceManager.EvaluateSecret(passwordRaw);

            var path = !string.IsNullOrWhiteSpace(options.Path) ?
                       options.Path :
                       settings.Store.CentralSsl.DefaultPath;

            if (path != null && path.ValidPath(log))
            {
                _path = path;
                _log.Debug("Using CentralSsl path: {_path}", _path);
            }
            else
            {
                throw new Exception($"Specified CentralSsl path {path} is not valid.");
            }
        }
示例#3
0
 public CentralSsl(ILogService log, CentralSslOptions options)
 {
     _log     = log;
     _options = options;
     if (!string.IsNullOrWhiteSpace(_options.Path))
     {
         _log.Debug("Using Centralized SSL path: {CentralSslStore}", _options.Path);
     }
 }
示例#4
0
        public CentralSsl(ILogService log, ISettingsService settings, CentralSslOptions options)
        {
            _log = log;

            _password = !string.IsNullOrWhiteSpace(options.PfxPassword?.Value) ?
                        options.PfxPassword.Value :
                        settings.Store.DefaultCentralSslPfxPassword;

            _path = !string.IsNullOrWhiteSpace(options.Path) ?
                    options.Path :
                    settings.Store.DefaultCentralSslStore;

            if (_path.ValidPath(log))
            {
                _log.Debug("Using Centralized SSL path: {_path}", _path);
            }
            else
            {
                throw new Exception($"Specified CentralSsl path {_path} is not valid.");
            }
        }
示例#5
0
        public CentralSsl(ILogService log, ISettingsService settings, CentralSslOptions options)
        {
            _log = log;

            _password = !string.IsNullOrWhiteSpace(options.PfxPassword?.Value) ?
                        options.PfxPassword.Value :
                        DefaultPassword(settings);

            var path = !string.IsNullOrWhiteSpace(options.Path) ?
                       options.Path :
                       DefaultPath(settings);

            if (path != null && path.ValidPath(log))
            {
                _path = path;
                _log.Debug("Using CentralSsl path: {_path}", _path);
            }
            else
            {
                throw new Exception($"Specified CentralSsl path {path} is not valid.");
            }
        }