Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50
throw CreateSslException(SR.net_allocate_ssl_context_failed);
}

if (!Interop.Ssl.Tls13Supported)
if (!Interop.Ssl.Capabilities.Tls13Supported)
{
if (protocols != SslProtocols.None &&
CipherSuitesPolicyPal.WantsTls13(protocols))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ internal static partial class Ssl
}

[DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool Tls13SupportedImpl();
internal static readonly bool Tls13Supported = Tls13SupportedImpl();
private static extern int Tls13SupportedImpl();

internal static class Capabilities
{
// needs separate type (separate static cctor) to be sure OpenSSL is initialized.
internal static readonly bool Tls13Supported = Tls13SupportedImpl() != 0;
}

internal static SafeSharedX509NameStackHandle SslGetClientCAList(SafeSslHandle ssl)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal sealed class CipherSuitesPolicyPal

internal CipherSuitesPolicyPal(IEnumerable<TlsCipherSuite> allowedCipherSuites)
{
if (!Interop.Ssl.Tls13Supported)
if (!Interop.Ssl.Capabilities.Tls13Supported)
{
throw new PlatformNotSupportedException(SR.net_ssl_ciphersuites_policy_not_supported);
}
Expand Down