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

◆ CreateFatalHandshakeAlertToken()

ProtocolToken System.Net.Security.SecureChannel.CreateFatalHandshakeAlertToken ( SslPolicyErrors sslPolicyErrors,
X509Chain chain )
inline

Definition at line 755 of file SecureChannel.cs.

756 {
758 {
759 SslPolicyErrors.RemoteCertificateChainErrors => GetAlertMessageFromChain(chain),
760 SslPolicyErrors.RemoteCertificateNameMismatch => TlsAlertMessage.BadCertificate,
761 _ => TlsAlertMessage.CertificateUnknown,
762 };
763 if (System.Net.NetEventSource.Log.IsEnabled())
764 {
765 System.Net.NetEventSource.Info(this, $"alertMessage:{tlsAlertMessage}", "CreateFatalHandshakeAlertToken");
766 }
767 SecurityStatusPal securityStatusPal = SslStreamPal.ApplyAlertToken(ref _credentialsHandle, _securityContext, TlsAlertType.Fatal, tlsAlertMessage);
769 {
770 if (System.Net.NetEventSource.Log.IsEnabled())
771 {
772 System.Net.NetEventSource.Info(this, $"ApplyAlertToken() returned {securityStatusPal.ErrorCode}", "CreateFatalHandshakeAlertToken");
773 }
774 if (securityStatusPal.Exception != null)
775 {
777 }
778 return null;
779 }
780 return GenerateAlertToken();
781 }
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static TlsAlertMessage GetAlertMessageFromChain(X509Chain chain)
SafeDeleteSslContext _securityContext
SafeFreeCredentials _credentialsHandle

References System.Net.Security.SecureChannel._credentialsHandle, System.Net.Security.SecureChannel._securityContext, System.Net.Security.SslStreamPal.ApplyAlertToken(), System.Net.Security.SecureChannel.GenerateAlertToken(), System.Net.Security.SecureChannel.GetAlertMessageFromChain(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, and System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw().

Referenced by System.Net.Security.SecureChannel.VerifyRemoteCertificate().