C#

C#

Made by DeepSource

Insecure protocol specified for ServicePointManager CS-S1007

Security
Critical
Autofix a05 owasp top 10

The SecurityProtocol property of ServicePointManager specifies the protocol used by the ServicePoint. The SecurityProtocolType.Tls protocol should ideally be avoided and a more comprehensive and robust protocol should be used in general. It is recommended that you review this configuration and choose a suitable alternative.

Bad Practice

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

Recommended

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls2 | SecurityProtocolType.Tls3;

// Alternatively, let the OS choose the best default
ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;

Reference