Skip to main content
Source: Al0083InsecureEndpointAnalyzer.cs

Description

Endpoints configured with http:// should use https:// in production to ensure encrypted communication.

Bad Code

builder.Services.AddHttpClient("api", c =>
    c.BaseAddress = new Uri("http://api.example.com"));

Good Code

builder.Services.AddHttpClient("api", c =>
    c.BaseAddress = new Uri("https://api.example.com"));

Properties

  • Category: Configuration
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0083.severity = warning