语言

HttpCookiesSection.RequireSSL 属性

定义

获取或设置一个值,该值指示是否需要安全套接字层 (SSL) 通信。

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 property bool RequireSSL { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("requireSSL", DefaultValue=false)]
public bool RequireSSL { get; set; }
[<System.Configuration.ConfigurationProperty("requireSSL", DefaultValue=false)>]
member this.RequireSSL : bool with get, set
Public Property RequireSSL As Boolean

属性值

true 如果启用了 SSL,则为否则,为 false. 默认值为 false。

属性

示例

下面的代码示例演示如何使用该 RequireSSL 属性。


// Get the current RequireSSL.
Boolean requireSSLValue = 
    httpCookiesSection.RequireSSL;

// Set the RequireSSL.
httpCookiesSection.RequireSSL = 
    false;

' Get the current RequireSSL.
Dim requireSSLValue As Boolean = _
httpCookiesSection.RequireSSL

' Set the RequireSSL.
httpCookiesSection.RequireSSL = _
False

注解

如 RFC 2109 中所述,该 RequireSSL 属性启用或禁用安全 Cookie 属性的输出。 当由合规浏览器使用时,仅使用 SSL/TLS 通过连接发送 Cookie。 默认值为 false。

适用于

另请参阅