예제 #1
0
        public bool IsSupportedServerProtocol(MSI.TlsProtocolCode protocol)
        {
            switch (protocol)
            {
            case MSI.TlsProtocolCode.Tls10:
                return((supportedProtocols & MSI.TlsProtocols.Tls10Client) != 0);

            case MSI.TlsProtocolCode.Tls11:
                return((supportedProtocols & MSI.TlsProtocols.Tls11Client) != 0);

            case MSI.TlsProtocolCode.Tls12:
                return((supportedProtocols & MSI.TlsProtocols.Tls12Client) != 0);

            default:
                return(false);
            }
        }
예제 #2
0
        public TlsConfiguration(MSI.TlsProtocols protocols, MSI.MonoTlsSettings settings, string targetHost)
        {
            supportedProtocols = protocols;
            requestedProtocol  = CheckProtocol(settings, ref supportedProtocols, false);
            TlsSettings        = settings;
            TargetHost         = targetHost;

            if (settings != null)
            {
                UserSettings = (UserSettings)settings.UserSettings;
            }
            if (UserSettings == null)
            {
                UserSettings = new UserSettings(settings);
            }

            RenegotiationFlags = DefaultRenegotiationFlags;
        }
예제 #3
0
        public TlsConfiguration(MSI.TlsProtocols protocols, MSI.MonoTlsSettings settings, MX.X509Certificate certificate, AsymmetricAlgorithm privateKey)
        {
            supportedProtocols = protocols;
            requestedProtocol  = CheckProtocol(settings, ref supportedProtocols, true);
            TlsSettings        = settings;
            Certificate        = certificate;
            PrivateKey         = privateKey;

            if (settings != null)
            {
                UserSettings = (UserSettings)settings.UserSettings;
            }
            if (UserSettings == null)
            {
                UserSettings = new UserSettings(settings);
            }

            RenegotiationFlags = DefaultRenegotiationFlags;
        }
예제 #4
0
 public static bool IsTls12OrNewer(MSI.TlsProtocolCode protocol)
 {
     return(IsTls12OrNewer((short)protocol));
 }