public static MonoNewTlsStream CreateServer( Stream innerStream, bool leaveOpen, RemoteCertificateValidationCallback certValidationCallback, LocalCertificateSelectionCallback certSelectionCallback, XEncryptionPolicy encryptionPolicy, TlsSettings settings, SSCX.X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var stream = new MonoNewTlsStream( innerStream, leaveOpen, ConvertCallback(certValidationCallback), ConvertCallback(certSelectionCallback), (XEncryptionPolicy)encryptionPolicy, settings); try { stream.AuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation); } catch (Exception ex) { var tlsEx = stream.LastError; if (tlsEx != null) { throw new AggregateException(ex, tlsEx); } throw; } return(stream); }
internal MonoNewTlsStream(Stream innerStream, bool leaveOpen, RemoteCertificateValidationCallback certValidationCallback, LocalCertificateSelectionCallback certSelectionCallback, EncryptionPolicy encryptionPolicy, MonoTlsSettings settings) : base(innerStream, leaveOpen, certValidationCallback, certSelectionCallback, encryptionPolicy, settings) { }