Ejemplo n.º 1
0
        static HttpsSocket()
        {
            m_config = Configuration.ServerConfig.GetConfig();

            if (string.IsNullOrEmpty(m_config.SSLLicenseKey))
            {
                // Get default License key
                SBUtils.Unit.SetLicenseKey(SSL_EVAL_LICENSE_KEY);
            }
            else
            {
                SBUtils.Unit.SetLicenseKey(m_config.SSLLicenseKey);
            }

            // Set security protocols
            if (m_config.Security.Tls10)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS1;
            }
            if (m_config.Security.Tls11)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS11;
            }
            if (m_config.Security.Tls12)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS12;
            }

            if (m_config.Security.ResumeSession)
            {
                m_sessionPool = new SBSessionPool.TElSessionPool();
            }

            m_certStorage.Add(LoadCertificate(m_config.CertificateName, m_config.CertificatePassword), true);
        }
Ejemplo n.º 2
0
        static HttpsSocket()
        {
            m_config = Configuration.ServerConfig.GetConfig();

            if (string.IsNullOrEmpty(m_config.SSLLicenseKey))
            {
                // Get default License key
                SBUtils.Unit.SetLicenseKey(SSL_EVAL_LICENSE_KEY);
            }
            else
            {
                SBUtils.Unit.SetLicenseKey(m_config.SSLLicenseKey);
            }

            // Set security protocols
            if (m_config.Security.Tls10)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS1;
            }
            if (m_config.Security.Tls11)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS11;
            }
            if (m_config.Security.Tls12)
            {
                m_protocols += SBSSLConstants.Unit.sbTLS12;
            }

            if (m_config.Security.ResumeSession)
            {
                m_sessionPool = new SBSessionPool.TElSessionPool();
            }

#if WindowsCE
            TElX509Certificate cert = LoadCertificate(m_config.CertificateName, m_config.CertificatePassword);
            m_certStorage.Add(cert, "Root", true, false, false);

            TElX509Certificate a = m_certStorage.GetCertificates(0);
            int b = m_certStorage.Count;

            m_certStorage.SystemStores.Add("Root");
#else
            m_certStorage.Add(LoadCertificate(m_config.CertificateName, m_config.CertificatePassword), true);
#endif
        }