ServicePointManager.SecurityProtocol Propriedade

Definição

Obtém ou define o protocolo de segurança usado pelos objetos ServicePoint gerenciados pelo objeto ServicePointManager.Gets or sets the security protocol used by the ServicePoint objects managed by the ServicePointManager object.

public:
 static property System::Net::SecurityProtocolType SecurityProtocol { System::Net::SecurityProtocolType get(); void set(System::Net::SecurityProtocolType value); };
public static System.Net.SecurityProtocolType SecurityProtocol { get; set; }
member this.SecurityProtocol : System.Net.SecurityProtocolType with get, set
Public Shared Property SecurityProtocol As SecurityProtocolType

Valor da propriedade

SecurityProtocolType

Um dos valores definidos na enumeração SecurityProtocolType.One of the values defined in the SecurityProtocolType enumeration.

Exceções

O valor especificado para definir a propriedade não é um valor de enumeração SecurityProtocolType válido.The value specified to set the property is not a valid SecurityProtocolType enumeration value.

Comentários

Essa propriedade seleciona a versão do protocolo SSL (SSL) ou protocolo TLS a ser usado para novas conexões; as conexões existentes não são alteradas.This property selects the version of the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol to use for new connections; existing connections aren't changed.

Começando com o .NET Framework 4,7, o valor padrão dessa propriedade é SecurityProtocolType.SystemDefault .Starting with the .NET Framework 4.7, the default value of this property is SecurityProtocolType.SystemDefault. Isso permite que .NET Framework APIs de rede baseadas em SslStream (como FTP, http e SMTP) herdem os protocolos de segurança padrão do sistema operacional ou de quaisquer configurações personalizadas executadas por um administrador do sistema.This allows .NET Framework networking APIs based on SslStream (such as FTP, HTTP, and SMTP) to inherit the default security protocols from the operating system or from any custom configurations performed by a system administrator. Para obter informações sobre quais protocolos SSL/TLS estão habilitados por padrão em cada versão do sistema operacional Windows, consulte protocolos em TLS/SSL (Schannel SSP).For information about which SSL/TLS protocols are enabled by default on each version of the Windows operating system, see Protocols in TLS/SSL (Schannel SSP).

Para versões do .NET Framework por meio do .NET Framework 4.6.2, nenhum valor padrão é listado para essa propriedade.For versions of the .NET Framework through the .NET Framework 4.6.2, no default value is listed for this property. A paisagem de segurança muda constantemente, e os protocolos e níveis de proteção padrão são alterados ao longo do tempo para evitar pontos fracos conhecidos.The security landscape changes constantly, and default protocols and protection levels are changed over time in order to avoid known weaknesses. Os padrões variam dependendo da configuração de computador individual, do software instalado e dos patches aplicados.Defaults vary depending on individual machine configuration, installed software, and applied patches.

Seu código nunca deve depender implicitamente do uso de um nível de proteção específico ou, supondo que um determinado nível de segurança seja usado por padrão.Your code should never implicitly depend on using a particular protection level, or on the assumption that a given security level is used by default. Se o seu aplicativo depende do uso de um determinado nível de segurança, você deve especificar explicitamente esse nível e, em seguida, verificar se ele está efetivamente em uso na conexão estabelecida.If your app depends on the use of a particular security level, you must explicitly specify that level and then check to be sure that it is actually in use on the established connection. Além disso, seu código deve ser projetado para ser robusto diante de alterações às quais os protocolos têm suporte, pois essas alterações geralmente são feitas com um pouco de aviso antecipado para reduzir as ameaças emergentes.Further, your code should be designed to be robust in the face of changes to which protocols are supported, as such changes are often made with little advance notice in order to mitigate emerging threats.

O .NET Framework 4,6 inclui um novo recurso de segurança que bloqueia algoritmos de codificação e hash não seguros para conexões.The .NET Framework 4.6 includes a new security feature that blocks insecure cipher and hashing algorithms for connections. Os aplicativos que usam TLS/SSL por meio de APIs como HttpClient, HttpWebRequest, FTPClient, SmtpClient, SslStream etc. e direcionamento .NET Framework 4,6 obtêm o comportamento mais seguro por padrão.Applications using TLS/SSL through APIs such as HttpClient, HttpWebRequest, FTPClient, SmtpClient, SslStream, etc. and targeting .NET Framework 4.6 get the more-secure behavior by default.

Os desenvolvedores podem optar por recusar esse comportamento para manter a interoperabilidade com os serviços SSL3s existentes ou os serviços de TLS w/RC4.Developers may want to opt out of this behavior in order to maintain interoperability with their existing SSL3 services OR TLS w/ RC4 services. Este artigo explica como modificar seu código para que o novo comportamento seja desabilitado.This article explains how to modify your code so that the new behavior is disabled.

Aplica-se a

Confira também