Repository: dotnet/runtime
File: src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs (C#)

Code before:
                catch (SecurityException)
                {
                    // Insufficient permission, assume that we don't have SSL3 (since we aren't exactly sure)
                    return false;
                }

                if (client is int c && server is int s)
                {
                    return c == 1 && s == 1;
                }

                // Missing key. If we're pre-20H1 then assume SSL3 is enabled.
                // Otherwise, disabled. (See comments on https://github.com/dotnet/runtime/issues/1166)
                // Alternatively the returned values must have been some other types.
                return !IsWindows10Version2004OrGreater;
            }

            return (IsOSX || (IsLinux && OpenSslVersion < new Version(1, 0, 2) && !IsDebian));
        }

        private static bool OpenSslGetTlsSupport(SslProtocols protocol)
        {
            if (!IsOpenSslSupported)
            {
                // on Windows and macOS TLS1.0/1.1 are supported.
                return false;
            }

            int ret = Interop.OpenSsl.OpenSslGetProtocolSupport((int)protocol);
            return ret == 1;
        }

        private static bool GetTls10Support()
        {
            // on Windows and macOS TLS1.0/1.1 are supported.
            if (IsWindows || IsOSXLike)
            {
                return true;
            }

            return OpenSslGetTlsSupport(SslProtocols.Tls);
        }

        private static bool GetTls11Support()
        {
            // on Windows and macOS TLS1.0/1.1 are supported.
            // TLS 1.1 and 1.2 can work on Windows7 but it is not enabled by default.
            if (IsWindows)
            {
                return !IsWindows7;
            }

Review comment (bug):
The comment doesn't make sense with the return.  Perhaps this if should just be `Debug.Assert(IsOpenSslSupported);`?

Code after:
                }
                catch (SecurityException)
                {
                    // Insufficient permission, assume that we don't have SSL3 (since we aren't exactly sure)
                    return false;
                }

                if (client is int c && server is int s)
                {
                    return c == 1 && s == 1;
                }

                // Missing key. If we're pre-20H1 then assume SSL3 is enabled.
                // Otherwise, disabled. (See comments on https://github.com/dotnet/runtime/issues/1166)
                // Alternatively the returned values must have been some other types.
                return !IsWindows10Version2004OrGreater;
            }

            return (IsOSX || (IsLinux && OpenSslVersion < new Version(1, 0, 2) && !IsDebian));
        }

        private static bool OpenSslGetTlsSupport(SslProtocols protocol)
        {
            Debug.Assert(IsOpenSslSupported);

            int ret = Interop.OpenSsl.OpenSslGetProtocolSupport((int)protocol);
            return ret == 1;
        }

        private static bool GetTls10Support()
        {
            // on Windows and macOS TLS1.0/1.1 are supported.
            if (IsWindows || IsOSXLike)
            {
                return true;
            }

            return OpenSslGetTlsSupport(SslProtocols.Tls);
        }

        private static bool GetTls11Support()
        {
            // on Windows and macOS TLS1.0/1.1 are supported.
            // TLS 1.1 and 1.2 can work on Windows7 but it is not enabled by default.
            if (IsWindows)
            {
                return !IsWindows7;
            }
            else if (IsOSXLike)
            {
                return true;