Beispiel #1
0
 public AcmeCertificateLoader(
     CertificateSelector selector,
     IHttpChallengeResponseStore challengeStore,
     IOptions <LettuceEncryptOptions> options,
     ILogger <AcmeCertificateLoader> logger,
     IServer server,
     IConfiguration config,
     TermsOfServiceChecker tosChecker,
     IEnumerable <ICertificateRepository> certificateRepositories,
     IClock clock,
     IHostApplicationLifetime applicationLifetime,
     TlsAlpnChallengeResponder tlsAlpnChallengeResponder,
     ICertificateAuthorityConfiguration certificateAuthority,
     IAccountStore?accountStore = default)
 {
     _selector                = selector;
     _challengeStore          = challengeStore;
     _accountStore            = accountStore;
     _options                 = options;
     _logger                  = logger;
     _server                  = server;
     _config                  = config;
     _tosChecker              = tosChecker;
     _certificateRepositories = certificateRepositories;
     _clock = clock;
     _applicationLifetime       = applicationLifetime;
     _tlsAlpnChallengeResponder = tlsAlpnChallengeResponder;
     _certificateAuthority      = certificateAuthority;
 }
Beispiel #2
0
        public AcmeCertificateFactory(
            AcmeClientFactory acmeClientFactory,
            TermsOfServiceChecker tosChecker,
            IOptions <LettuceEncryptOptions> options,
            IHttpChallengeResponseStore challengeStore,
            IAccountStore?accountRepository,
            ILogger <AcmeCertificateFactory> logger,
            IHostApplicationLifetime appLifetime,
            ICertificateAuthorityConfiguration certificateAuthority)
        {
            _acmeClientFactory = acmeClientFactory;
            _tosChecker        = tosChecker;
            _options           = options;
            _challengeStore    = challengeStore;
            _logger            = logger;

            _appStarted = new TaskCompletionSource <object?>();
            appLifetime.ApplicationStarted.Register(() => _appStarted.TrySetResult(null));
            if (appLifetime.ApplicationStarted.IsCancellationRequested)
            {
                _appStarted.TrySetResult(null);
            }

            _accountRepository = accountRepository ?? new FileSystemAccountStore(logger, certificateAuthority);
        }