Skip to content

[Query Create]: C# - Global SSL disable is bad #1

@felickz

Description

@felickz

Target Language

csharp

Query Name (Optional)

Global SSL disable

Query Type

Security

Query Description

A huge anti pattern in .net is to set the global SSL config to always return true - this impacts all subsqueent requests.

Expected Severity

High

Code Examples

// Source - https://stackoverflow.com/a/18624335
// Posted by Adam Venezia, modified by community. See post 'Timeline' for change history
// Retrieved 2026-01-26, License - CC BY-SA 3.0

ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

CWE/CVE Reference (Optional)

(help me figure this out!)

References (Optional)

https://stackoverflow.com/a/18624335

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions