-
Notifications
You must be signed in to change notification settings - Fork 3
Description
protected BaseClient(ClientConfiguration clientConfiguration)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
......
}
BaseClient should not change the SecurityProtocol like this in an application. Effectively this changes the behavior for ALL new ServicePoints to only accept Tls12 connections on SSL as ServicePointManager is a static class.
See: https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netframework-4.8
.NET 4.8/NET CORE 3.0 preview 9 includes support for Tls13 and I regard it as a bad decision to have an client api that change this behavior for the host application.
See: https://docs.microsoft.com/en-us/dotnet/api/system.net.securityprotocoltype?view=netframework-4.8
Your APIs on the serversside however should only accept Tls1.2 (or Tls1.3) connections.
I would propose to change the code to:
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol |
SecuritySecurityProtocolType.Tls12;
which would ensure that Tls12 is enabled on the client.
Or you could remove this entirely and add this as a requirement in the documentation.