Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -80,7 +80,7 @@ private static SslProtocols CalculateEffectiveProtocols(SslAuthenticationOptions
{
SslProtocols protocols = sslAuthenticationOptions.EnabledSslProtocols;

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 @@ -149,6 +149,16 @@ internal static partial class Ssl
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
internal static partial int SslSetData(IntPtr ssl, IntPtr data);

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

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

internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, List<SslApplicationProtocol> protocols)
{
byte[] buffer = ConvertAlpnProtocolListToByteArray(protocols);
Expand Down Expand Up @@ -190,10 +200,6 @@ internal static byte[] ConvertAlpnProtocolListToByteArray(List<SslApplicationPro
return ret;
}

[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
private static partial int Tls13SupportedImpl();
internal static readonly bool Tls13Supported = Tls13SupportedImpl() != 0;

internal static SafeSharedX509NameStackHandle SslGetClientCAList(SafeSslHandle ssl)
{
Crypto.CheckValidOpenSslHandle(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