共用方式為


SslStreamSecurityBindingElement.SslProtocols 屬性

定義

指定使用用戶端認證類型 TcpClientCredentialType.Certificate 時所要交涉的 SSL/TLS 通訊協定清單。 此值可以是下列一或多個列舉成員的組合: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

範例

NetTcpBinding netTcpBinding = new NetTcpBinding(SecurityMode.Transport);  
netTcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;  
CustomBinding b = new CustomBinding(netTcpBinding);  
SslStreamSecurityBindingElement sslStream = b.Elements.Find<SslStreamSecurityBindingElement>();  
sslStream.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。 4.6 之前的架構版本僅支援 Ssl3 和 Tls。 如果未包含這些專案,將無法與舊版架構通訊。 指定 Tls11 和/或 Tls12 將會停用 Ssl3 的使用,即使已包含它也一樣。

適用於