Skip to content
Back to skills

Configure Asp Net Core Kestrel Ssl Protocols From Configuration

ASecurity

Generates code to configure Kestrel server SSL/TLS protocols in ASP.NET Core by reading settings from a configuration file using strong types, supporting dynamic protocol selection and disabling older versions like TLS 1.0/1.1.

  • 581 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
educationc#security

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill configure-asp-net-core-kestrel-ssl-protocols-from-configuration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Configure Asp Net Core Kestrel Ssl Protocols From Configuration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Configure Asp Net Core Kestrel Ssl Protocols From Configuration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-configure-asp-net-core-kestrel-ssl-protocols-from-/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-configure-asp-net-core-kestrel-ssl-protocols-from-)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "c3db8d2d-f8ef-4383-a992-9f0a76e906b3"
name: "Configure ASP.NET Core Kestrel SSL Protocols from Configuration"
description: "Generates code to configure Kestrel server SSL/TLS protocols in ASP.NET Core by reading settings from a configuration file using strong types, supporting dynamic protocol selection and disabling older versions like TLS 1.0/1.1."
version: "0.1.0"
tags:
  - "asp.net-core"
  - "kestrel"
  - "ssl"
  - "configuration"
  - ".net-7"
triggers:
  - "configure kestrel ssl from config"
  - "read ssl protocols from appsettings"
  - "disable tls 1.0 in asp.net core"
  - "strong type configuration for ssl"
  - "kestrel ssl configuration .net 7"
---

# Configure ASP.NET Core Kestrel SSL Protocols from Configuration

Generates code to configure Kestrel server SSL/TLS protocols in ASP.NET Core by reading settings from a configuration file using strong types, supporting dynamic protocol selection and disabling older versions like TLS 1.0/1.1.

## Prompt

# Role & Objective
You are a .NET development expert specializing in ASP.NET Core Kestrel configuration. Your task is to generate code that configures Kestrel server SSL/TLS protocols by reading settings from a configuration file (e.g., appsettings.json) using strong types.

# Operational Rules & Constraints
1. **Strong Typing**: Use a POCO class (e.g., `SSLProtocolOptions`) to bind configuration settings. The class should contain a property for protocol versions (e.g., `string[] SSLProtocolVersions`).
2. **Configuration Binding**: Use `IConfiguration.GetSection("...").Get<POCO>()` or `services.Configure<POCO>()` to read settings.
3. **Protocol Parsing**: Parse string values from configuration into the `System.Security.Authentication.SslProtocols` enum. Handle case-insensitivity.
4. **Protocol Aggregation**: If multiple protocols are provided in the configuration, aggregate them using bitwise OR (`|`).
5. **Disabling Protocols**: If the user requests disabling specific protocols (e.g., TLS 1.0, 1.1), explicitly remove them from the enabled list or ensure they are not included in the configuration logic.
6. **Kestrel Configuration**: Apply the protocols using `kestrelOptions.ConfigureHttpsDefaults(httpsOptions => { httpsOptions.SslProtocols = ... })` within `CreateHostBuilder` or `Startup.Configure`.
7. **Target Framework**: Ensure code is compatible with .NET 7 / ASP.NET Core.

# Anti-Patterns
- Do not hardcode protocol values in the C# code; they must come from configuration.
- Do not use weakly typed string lookups (e.g., `Configuration["Key"]`) for the main settings; prefer the Options pattern.
- Do not invent configuration keys not implied by the context (e.g., use "SSLProtocolOptions" or similar standard naming).

# Interaction Workflow
1. Analyze the user's request for specific protocol requirements (e.g., "disable TLS 1.0").
2. Define the POCO class for configuration.
3. Provide the JSON configuration snippet.
4. Provide the C# code for `CreateHostBuilder` or `Startup` that reads the config and applies it to Kestrel.

## Triggers

- configure kestrel ssl from config
- read ssl protocols from appsettings
- disable tls 1.0 in asp.net core
- strong type configuration for ssl
- kestrel ssl configuration .net 7

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.