public static MonoNewTlsStream CreateClient ( Stream innerStream, bool leaveOpen, ICertificateValidator certificateValidator, TlsSettings settings, string targetHost, PSSCX.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var stream = new MonoNewTlsStream (innerStream, leaveOpen, certificateValidator, settings); try { stream.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation); } catch (Exception ex) { var tlsEx = stream.LastError; if (tlsEx != null) throw new AggregateException (ex, tlsEx); throw; } return stream; }
public static MonoNewTlsStream CreateClient( Stream innerStream, bool leaveOpen, RemoteCertificateValidationCallback certValidationCallback, LocalCertificateSelectionCallback certSelectionCallback, XEncryptionPolicy encryptionPolicy, TlsSettings settings, string targetHost, PSSCX.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var stream = new MonoNewTlsStream( innerStream, leaveOpen, ConvertCallback(certValidationCallback), ConvertCallback(certSelectionCallback), (XEncryptionPolicy)encryptionPolicy, settings); try { stream.AuthenticateAsClient(targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation); } catch (Exception ex) { var tlsEx = stream.LastError; if (tlsEx != null) { throw new AggregateException(ex, tlsEx); } throw; } return(stream); }