Ejemplo n.º 1
0
        public LetoConnectionFilter(LetoConnectionFilterOptions options, IConnectionFilter previous, ILoggerFactory loggerFactory)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (previous == null)
            {
                throw new ArgumentNullException(nameof(previous));
            }
            _factory         = new PipelineFactory();
            _certificateList = new CertificateList();
            var prov = new Tls13.Certificates.OpenSsl11.CertificateProvider();

            _certificateList.AddCertificate(prov.LoadPfx12(options.PfxPath, options.PfxPassword));
            _listener      = new SecurePipelineListener(_factory, _certificateList, loggerFactory);
            _previous      = previous;
            _loggerFactory = loggerFactory;
        }
Ejemplo n.º 2
0
        public static KestrelServerOptions UseLetoHttps(this KestrelServerOptions kestrelOptions, LetoConnectionFilterOptions options)
        {
            var prevFilter    = kestrelOptions.ConnectionFilter ?? new NoOpConnectionFilter();
            var loggerFactory = kestrelOptions.ApplicationServices.GetRequiredService <ILoggerFactory>();
            var filter        = new LetoConnectionFilter(options, prevFilter, loggerFactory);

            kestrelOptions.ConnectionFilter = filter;
            return(kestrelOptions);
        }
Ejemplo n.º 3
0
 public LetoConnectionFilter(LetoConnectionFilterOptions options, IConnectionFilter previous)
     : this(options, previous, loggerFactory : null)
 {
 }