示例#1
0
        public unsafe HttpConfigSslEntry(HttpApi.HTTP_SERVICE_CONFIG_SSL_KEY key, HttpApi.HTTP_SERVICE_CONFIG_SSL_PARAM param)
        {
            byte *        p  = (byte *)key.pIpPort;
            SocketAddress sa = new SocketAddress(0, 48);

            for (int i = 0; i < sa.Size; i++)
            {
                sa[i] = *(p++);
            }
            IPEndPoint ep;

            if (sa.Family == AddressFamily.InterNetwork)
            {
                ep = (IPEndPoint) new IPEndPoint(IPAddress.Any, 0).Create(sa);
            }
            else
            {
                ep = (IPEndPoint) new IPEndPoint(IPAddress.IPv6Any, 0).Create(sa);
            }
            this.endPoint = ep;
            if (param.SslHashLength > 0 && param.pSslHash != IntPtr.Zero)
            {
                this.sslHash = new byte[param.SslHashLength];
                Marshal.Copy(param.pSslHash, this.sslHash, 0, (int)param.SslHashLength);
            }
            this.appId = param.AppId;
            if (!string.IsNullOrEmpty(param.pSslCertStoreName))
            {
                this.sslCertStoreName = param.pSslCertStoreName;
            }
            else
            {
                this.sslCertStoreName = StoreName.My.ToString();
            }
            this.defaultCertCheckMode                 = param.DefaultCertCheckMode;
            this.defaultRevocationFreshnessTime       = TimeSpan.FromSeconds(param.DefaultRevocationFreshnessTime);
            this.defaultRevocationUrlRetrievalTimeout = TimeSpan.FromMilliseconds(param.DefaultRevocationUrlRetrievalTimeout);
            this.defaultSslCtlIdentifier              = param.pDefaultSslCtlIdentifier;
            this.defaultSslCtlStoreName               = param.pDefaultSslCtlStoreName;
            this.defaultFlags = param.DefaultFlags;
        }
示例#2
0
 public void Add(HttpApi.HTTP_SERVICE_CONFIG_SSL_KEY key, HttpApi.HTTP_SERVICE_CONFIG_SSL_PARAM param)
 {
     base.Add(new HttpConfigSslEntry(key, param));
 }