TcpTransportSecurity.SslProtocols 屬性

定義

指定使用用戶端認證類型 TcpClientCredentialType.Certificate 時所要交涉的 SSL/TLS 通訊協定清單。Specifies the list of SSL/TLS protocols to negotiate when using a client credential type of TcpClientCredentialType.Certificate. 此值可以是下列一或多個列舉成員的組合:Ssl3、Tls、Tls11、Tls12。The value can be a combination of one of more of the following enumeration members: Ssl3, Tls, Tls11, Tls12.

public:
 property System::Security::Authentication::SslProtocols SslProtocols { System::Security::Authentication::SslProtocols get(); void set(System::Security::Authentication::SslProtocols value); };
public System.Security.Authentication.SslProtocols SslProtocols { get; set; }
member this.SslProtocols : System.Security.Authentication.SslProtocols with get, set
Public Property SslProtocols As SslProtocols

屬性值

SslProtocols

傳回 SslProtocolsReturns SslProtocols.

範例

NetTcpBinding b = new NetTcpBinding();  
b.Security.Mode = SecurityMode.Transport;  
b.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;  
b.Security.Transport.SslProtocols = SslProtocols.Tls11 | SslProtocols.Tls12;  
EndpointAddress a = new EndpointAddress("net.tcp://contoso.com/TcpAddress");  
ChannelFactory<ICalculator> cf = new ChannelFactory<ICalculator>(b, a);  
cf.Credentials.ClientCertificate.SetCertificate(  
    StoreLocation.LocalMachine,  
    StoreName.My,  
    X509FindType.FindByThumbprint,  
    "0000000000000000000000000000000000000000");  

備註

預設值為 Ssl3 | Tls | Tls11 | Tls12。The default value is Ssl3 | Tls | Tls11 | Tls12. 4.6 之前的 framework 版本僅支援 Ssl3 和 Tls。Versions of the framework prior to 4.6 only support Ssl3 and Tls. 如果未包含這些版本,將無法與舊版的 framework 進行通訊。If these are not included, communication with earlier versions of the framework will not be possible. 指定 Tls11 和/或 Tls12 將會停用 Ssl3 的使用方式,即使已包含它也一樣。Specifying Tls11 and/or Tls12 will disable the usage of Ssl3, even if it has been included.

適用於