public TlsConnectionAdapter(TlsConnectionAdapterOptions options, ILoggerFactory loggerFactory)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (options.CertificatePath == null)
            {
                throw new ArgumentException("Certificate path must be non-null.", nameof(options));
            }

            if (options.Password == null)
            {
                throw new ArgumentException("Password must be non-null.", nameof(options));
            }

            _options = options;
            _logger  = loggerFactory?.CreateLogger(nameof(TlsConnectionAdapter));

            // Order is important. If HTTP/2 is enabled, we prefer it over HTTP/1.1. So add it first.
            if ((options.Protocols & HttpProtocols.Http2) == HttpProtocols.Http2)
            {
                _serverProtocols.Add("h2");
            }

            if ((options.Protocols & HttpProtocols.Http1) == HttpProtocols.Http1)
            {
                _serverProtocols.Add("http/1.1");
            }
        }
 public TlsConnectionAdapter(TlsConnectionAdapterOptions options)
     : this(options, loggerFactory : null)
 {
 }