internal static HttpsConnectionAdapterOptions UseLettuceEncrypt(
     this HttpsConnectionAdapterOptions httpsOptions,
     IServerCertificateSelector selector,
     TlsAlpnChallengeResponder tlsAlpnChallengeResponder
     )
 {
     httpsOptions.OnAuthenticate = tlsAlpnChallengeResponder.OnSslAuthenticate;
     httpsOptions.UseServerCertificateSelector(selector);
     return(httpsOptions);
 }
Esempio n. 2
0
    internal static HttpsConnectionAdapterOptions UseLettuceEncrypt(
        this HttpsConnectionAdapterOptions httpsOptions,
        IServerCertificateSelector selector,
        TlsAlpnChallengeResponder tlsAlpnChallengeResponder
        )
    {
        // Check if this handler is already set. If so, chain our handler before it.
        var otherHandler = httpsOptions.OnAuthenticate;

        httpsOptions.OnAuthenticate = (ctx, options) =>
        {
            tlsAlpnChallengeResponder.OnSslAuthenticate(ctx, options);
            otherHandler?.Invoke(ctx, options);
        };

        httpsOptions.UseServerCertificateSelector(selector);
        return(httpsOptions);
    }
 public KestrelOptionsSetup(IServerCertificateSelector certificateSelector, TlsAlpnChallengeResponder tlsAlpnChallengeResponder)
 {
     _certificateSelector       = certificateSelector ?? throw new ArgumentNullException(nameof(certificateSelector));
     _tlsAlpnChallengeResponder = tlsAlpnChallengeResponder ?? throw new ArgumentNullException(nameof(tlsAlpnChallengeResponder));
 }
 public TlsAlpn01DomainValidator(TlsAlpnChallengeResponder tlsAlpnChallengeResponder,
                                 IHostApplicationLifetime appLifetime,
                                 AcmeClient client, ILogger logger, string domainName) : base(appLifetime, client, logger, domainName)
 {
     _tlsAlpnChallengeResponder = tlsAlpnChallengeResponder;
 }