Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SslAuthenticationOptions() [2/3]

System.Net.Security.SslAuthenticationOptions.SslAuthenticationOptions ( SslServerAuthenticationOptions sslServerAuthenticationOptions)
inlinepackage

Definition at line 71 of file SslAuthenticationOptions.cs.

72 {
75 CheckCertName = false;
77 EncryptionPolicy = sslServerAuthenticationOptions.EncryptionPolicy;
78 IsServer = true;
79 RemoteCertRequired = sslServerAuthenticationOptions.ClientCertificateRequired;
80 if (System.Net.NetEventSource.Log.IsEnabled())
81 {
82 System.Net.NetEventSource.Info(this, $"Server RemoteCertRequired: {RemoteCertRequired}.", ".ctor");
83 }
84 TargetHost = string.Empty;
87 if (sslServerAuthenticationOptions.ServerCertificateContext != null)
88 {
89 CertificateContext = sslServerAuthenticationOptions.ServerCertificateContext;
90 }
91 else if (sslServerAuthenticationOptions.ServerCertificate != null)
92 {
93 if (sslServerAuthenticationOptions.ServerCertificate is X509Certificate2 { HasPrivateKey: not false } x509Certificate)
94 {
95 CertificateContext = SslStreamCertificateContext.Create(x509Certificate, null);
96 }
97 else
98 {
99 X509Certificate2 x509Certificate2 = SecureChannel.FindCertificateWithPrivateKey(this, isServer: true, sslServerAuthenticationOptions.ServerCertificate);
100 if (x509Certificate2 == null)
101 {
103 }
104 CertificateContext = SslStreamCertificateContext.Create(x509Certificate2);
105 }
106 }
107 if (sslServerAuthenticationOptions.RemoteCertificateValidationCallback != null)
108 {
109 CertValidationDelegate = sslServerAuthenticationOptions.RemoteCertificateValidationCallback;
110 }
111 }
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
RemoteCertificateValidationCallback CertValidationDelegate
static SslProtocols FilterOutIncompatibleSslProtocols(SslProtocols protocols)
static SslStreamCertificateContext Create(X509Certificate2 target, X509Certificate2Collection? additionalCertificates, bool offline)
static string net_ssl_io_no_server_cert
Definition SR.cs:52
Definition SR.cs:7

References System.Net.Security.SslAuthenticationOptions.AllowRenegotiation, System.Net.Security.SslAuthenticationOptions.ApplicationProtocols, System.Net.Security.SslAuthenticationOptions.CertificateContext, System.Net.Security.SslAuthenticationOptions.CertificateRevocationCheckMode, System.Net.Security.SslAuthenticationOptions.CertValidationDelegate, System.Net.Security.SslAuthenticationOptions.CheckCertName, System.Net.Security.SslStreamCertificateContext.Create(), System.Net.Security.SslAuthenticationOptions.EnabledSslProtocols, System.Net.Security.SslAuthenticationOptions.FilterOutIncompatibleSslProtocols(), System.Net.Security.SecureChannel.FindCertificateWithPrivateKey(), System.Net.NetEventSource.Info(), System.Net.Security.SslAuthenticationOptions.IsServer, System.Net.NetEventSource.Log, System.SR.net_ssl_io_no_server_cert, System.Net.Security.SslAuthenticationOptions.RemoteCertRequired, and System.Net.Security.SslAuthenticationOptions.TargetHost.