public static void AddFluffySpoonLetsEncryptRenewalService(
     this IServiceCollection services,
     LetsEncryptOptions options)
 {
     services.AddFluffySpoonLetsEncryptPersistenceService();
     services.AddSingleton(options);
     services.AddTransient <ILetsEncryptRenewalService, LetsEncryptRenewalService>();
     services.AddTransient <IHostedService, LetsEncryptRenewalService>();
 }
Пример #2
0
        public LetsEncryptRenewalService(
            IEnumerable <ICertificateRenewalLifecycleHook> lifecycleHooks,
            IPersistenceService persistenceService,
            ILogger <ILetsEncryptRenewalService> logger,
            LetsEncryptOptions options)
        {
            _lifecycleHooks     = lifecycleHooks;
            _persistenceService = persistenceService;
            _logger             = logger;
            _options            = options;

            _semaphoreSlim = new SemaphoreSlim(1);
        }
        public static void AddFluffySpoonLetsEncrypt(
            this IServiceCollection services,
            LetsEncryptOptions options)
        {
            services.AddTransient <IConfigureOptions <KestrelServerOptions>, KestrelOptionsSetup>();

            services.AddFluffySpoonLetsEncryptPersistenceService();

            services.AddSingleton(options);

            services.AddSingleton <ILetsEncryptClientFactory, LetsEncryptClientFactory>();
            services.AddSingleton <ICertificateValidator, CertificateValidator>();
            services.AddSingleton <ICertificateProvider, CertificateProvider>();
            services.AddTransient <ILetsEncryptRenewalService, LetsEncryptRenewalService>();
            services.AddTransient <IHostedService, LetsEncryptRenewalService>();
        }