216 string[] result =
Array.Empty<
string>();
359 x509Chain.ChainElements[
k].Certificate.Dispose();
382 if (
list !=
null &&
list.Count != 0)
480 System.
Net.
NetEventSource.
Error(
this,
$"ServerCertSelectionDelegate returned no certificaete for '{_sslAuthenticationOptions.TargetHost}'.",
"AcquireServerCredentials");
498 System.
Net.
NetEventSource.
Error(
this,
$"CertSelectionDelegate returned no certificaete for '{_sslAuthenticationOptions.TargetHost}'.",
"AcquireServerCredentials");
559 System.
Net.
NetEventSource.
Error(
this,
$"Authentication failed. Status: {securityStatusPal}, Exception message: {protocolToken.GetException().Message}",
"NextMessage");
566 byte[] outputBuffer =
Array.Empty<
byte>();
686 if (
trust._store !=
null)
690 if (
trust._trustList !=
null)
739 x509Chain.ChainElements[
j].Certificate.Dispose();
760 SslPolicyErrors.RemoteCertificateNameMismatch =>
TlsAlertMessage.BadCertificate,
861 string text =
"ChainStatus: ";
int IList. IndexOf(object value)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
static void SuppressFinalize(object obj)
static unsafe string[] GetRequestCertificateAuthorities(SafeDeleteContext securityContext)
static X509Certificate2 GetRemoteCertificate(SafeDeleteContext securityContext)
static SslPolicyErrors VerifyCertificateProperties(SafeDeleteContext securityContext, X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string hostName)
static X509Store EnsureStoreOpened(bool isMachineStore)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static void DumpBuffer(object thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string memberName=null)
bool AcquireServerCredentials(ref byte[] thumbPrint)
static TlsAlertMessage GetAlertMessageFromChain(X509Chain chain)
ProtocolToken CreateShutdownToken()
void LogCertificateValidation(RemoteCertificateValidationCallback remoteCertValidationCallback, SslPolicyErrors sslPolicyErrors, bool success, X509Chain chain)
static readonly Oid s_clientAuthOid
SafeDeleteSslContext _securityContext
ChannelBinding GetChannelBinding(ChannelBindingKind kind)
bool IsRemoteCertificateAvailable
X509Certificate LocalClientCertificate
bool _remoteCertificateExposed
SecurityStatusPal Decrypt(Span< byte > buffer, out int outputOffset, out int outputCount)
X509Certificate _selectedClientCertificate
void ProcessHandshakeSuccess()
SecurityStatusPal Encrypt(ReadOnlyMemory< byte > buffer, ref byte[] output, out int resultSize)
X509RevocationMode CheckCertRevocationStatus
SecurityStatusPal Renegotiate(out byte[] output)
static X509Certificate2 FindCertificateWithPrivateKey(object instance, bool isServer, X509Certificate certificate)
SslConnectionInfo ConnectionInfo
SafeFreeCredentials _credentialsHandle
static X509Certificate2 MakeEx(X509Certificate certificate)
ProtocolToken GenerateAlertToken()
bool AcquireClientCredentials(ref byte[] thumbPrint)
SslApplicationProtocol NegotiatedApplicationProtocol
X509Certificate2 _remoteCertificate
string[] GetRequestCertificateAuthorities()
SslApplicationProtocol _negotiatedApplicationProtocol
bool VerifyRemoteCertificate(RemoteCertificateValidationCallback remoteCertValidationCallback, SslCertificateTrust trust, ref ProtocolToken alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus)
void SetRefreshCredentialNeeded()
SslConnectionInfo _connectionInfo
ProtocolToken NextMessage(ReadOnlySpan< byte > incomingBuffer)
SecureChannel(SslAuthenticationOptions sslAuthenticationOptions, SslStream sslStream)
static List< T > EnsureInitialized< T >(ref List< T > list)
X509Certificate RemoteCertificate
ProtocolToken CreateFatalHandshakeAlertToken(SslPolicyErrors sslPolicyErrors, X509Chain chain)
SecurityStatusPal GenerateToken(ReadOnlySpan< byte > inputBuffer, ref byte[] output)
bool _refreshCredentialNeeded
readonly SslAuthenticationOptions _sslAuthenticationOptions
static readonly Oid s_serverAuthOid
X509Certificate LocalServerCertificate
X509CertificateCollection ClientCertificates
SslStreamCertificateContext CertificateContext
LocalCertSelectionCallback CertSelectionDelegate
EncryptionPolicy EncryptionPolicy
SslProtocols EnabledSslProtocols
X509RevocationMode CertificateRevocationCheckMode
ServerCertSelectionCallback ServerCertSelectionDelegate
static SafeFreeCredentials TryCachedCredential(byte[] thumbPrint, SslProtocols sslProtocols, bool isServer, EncryptionPolicy encryptionPolicy)
static void CacheCredential(SafeFreeCredentials creds, byte[] thumbPrint, SslProtocols sslProtocols, bool isServer, EncryptionPolicy encryptionPolicy)
static SslStreamCertificateContext Create(X509Certificate2 target, X509Certificate2Collection? additionalCertificates, bool offline)
readonly X509Certificate2 Certificate
static void QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo)
static SafeFreeCredentials AcquireCredentialsHandle(SslStreamCertificateContext certificateContext, SslProtocols protocols, EncryptionPolicy policy, bool isServer)
static SecurityStatusPal ApplyAlertToken(ref SafeFreeCredentials credentialsHandle, SafeDeleteContext securityContext, TlsAlertType alertType, TlsAlertMessage alertMessage)
static SecurityStatusPal ApplyShutdownToken(ref SafeFreeCredentials credentialsHandle, SafeDeleteContext securityContext)
static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, string targetName, ReadOnlySpan< byte > inputBuffer, ref byte[] outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
static SecurityStatusPal AcceptSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, ReadOnlySpan< byte > inputBuffer, ref byte[] outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
static unsafe SecurityStatusPal DecryptMessage(SafeDeleteSslContext securityContext, Span< byte > buffer, out int offset, out int count)
static void VerifyPackageInfo()
static SecurityStatusPal Renegotiate(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, SslAuthenticationOptions sslAuthenticationOptions, out byte[] outputBuffer)
static void QueryContextStreamSizes(SafeDeleteContext securityContext, out StreamSizes streamSizes)
static unsafe SecurityStatusPal EncryptMessage(SafeDeleteSslContext securityContext, ReadOnlyMemory< byte > input, int headerSize, int trailerSize, ref byte[] output, out int resultSize)
static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute)
static byte[] GetNegotiatedApplicationProtocol(SafeDeleteContext context)
static string net_ssl_io_no_server_cert
static string net_log_remote_cert_name_mismatch
static string net_log_remote_cert_not_available
static string net_log_remote_cert_has_errors
SecurityStatusPalErrorCode
static readonly IntPtr Zero
readonly System.Net.SecurityStatusPalErrorCode ErrorCode