Security

TLS Security Settings Explained: What to Enable and Disable

The TLS security settings that matter are the allowed protocol versions, the cipher suite order, and, for websites, the HSTS header. Allow TLS 1.2 and TLS 1.3, turn off everything older, and keep the other settings at your operating system's defaults unless you have a specific reason to change them.

This article covers what each setting does and where to change it on Windows, in .NET apps and on a website. Settings differ by product, so the exact menu or file will vary on other servers and devices. For the history of the SSL and TLS version names, see SSL vs TLS: what's the difference.

TLS security settings at a glance

SettingRecommendedWhere to change it
Protocol versionsTLS 1.2 and TLS 1.3 onlyServer or OS config; Schannel registry on Windows
Cipher suitesOS defaults, or an ordered list that excludes weak suitesGroup Policy, MDM or the TLS PowerShell module on Windows
HSTSmax-age of at least 1 year on websitesHTTP response header from your web server
OCSP staplingOn, where the server supports itWeb server config; EnableOcspStaplingForSni for some IIS bindings
Minimum key sizesLeave at OS defaults unless policy requires moreSchannel KeyExchangeAlgorithms registry keys

Which TLS versions to allow

Allow TLS 1.2 and TLS 1.3. RFC 8996 (March 2021, BCP 195) states that "TLS 1.0 MUST NOT be used" and "TLS 1.1 MUST NOT be used", and that negotiation of either version from any version of TLS must not be permitted. Microsoft's .NET Framework guidance takes the same position: it covers TLS 1.2 and TLS 1.3 only and calls TLS 1.0 and 1.1 deprecated.

Your operating system sets the ceiling. For .NET Framework apps on Schannel, Microsoft's table shows TLS 1.2 as the highest version on Windows 10 and TLS 1.3 on Windows 11 (for apps targeting .NET Framework 4.6.2 or later). To check what a server negotiates, see the openssl s_client commands in the SSL vs TLS article.

How to change TLS versions on Windows (Schannel)

Windows applications that use the system TLS stack go through Schannel. Its protocol settings live under this registry path:

HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols

Under it you create a subkey named <protocol> <major>.<minor>\Client or \Server. Microsoft's examples are SSL 3.0\Client, TLS 1.2\Server and DTLS 1.2\Client. In that subkey:

  • A DWORD named Enabled set to 1 overrides the system default and enables that version.
  • Enabled set to 0 disables it, and Schannel will not negotiate it whatever the application asks for.

Three limits from Microsoft's documentation:

  • These settings only restrict or re-enable versions Windows supports. You cannot add a version the OS lacks.
  • They affect only Schannel. Software that ships its own TLS library, such as many browsers and some servers, is not changed.
  • A restart of the application or service may be needed, because services tend to reuse credential handles across connections.

Microsoft also warns that disabling versions can make AcquireCredentialsHandle calls fail if no version remains that both the system and the caller allow, and that reducing the enabled set can break interoperability with remote peers. It advises against creating Schannel registry values that its article does not describe. Prefer Group Policy or other Windows tools to hand-editing the registry when you can.

How to set the cipher suite order

A cipher suite is a set of cryptographic algorithms used for a connection. On Windows, Microsoft says TLS ciphers, hashes and key exchange algorithms should all be controlled through the cipher suite order, not through separate registry keys. There are three supported routes:

  1. Group Policy: Computer Configuration > Administrative Templates > Network > SSL Configuration Settings > SSL Cipher Suite Order. Set it to Enabled, then replace the list with your ordered, comma-delimited list. The list is limited to 1,023 characters.
  2. MDM: the Cryptography/TLSCipherSuites policy in the Windows 10 Policy CSP.
  3. PowerShell: the TLS module can list the ordered cipher suites and enable or disable individual ones.

Changes take effect on the next boot; until then the existing order stays in effect. Microsoft says editing the registry entries for the default priority order is not supported and may be reset by servicing updates. The default order differs between Windows versions, so check Microsoft's "Cipher Suites in TLS/SSL (Schannel SSP)" page for yours before changing anything.

Elliptic curve order is a separate setting on Windows 10 and Windows Server 2016 and later. If the cipher suite list names curves, the separate ECC curve order overrides them when it is enabled.

Minimum key sizes on Windows

For the TLS client, Windows lets you set a minimum bit length for Diffie-Hellman and RSA key exchange by creating a ClientMinKeyBitLength DWORD. If you do not set it, the minimum is 1,024 bits. The keys are under SCHANNEL\KeyExchangeAlgorithms\Diffie-Hellman and SCHANNEL\KeyExchangeAlgorithms\PKCS (the RSA entry). On the server side, RSA key strength is determined by the server certificate. Microsoft says these entries may not exist and have to be created by hand, and that use of key exchange algorithms should be controlled through the cipher suite order.

TLS settings for .NET Framework apps

If you write software, the safest setting is usually to set nothing. Microsoft recommends not specifying a TLS version in code, so the OS chooses and the app picks up new versions automatically:

  • Leave ServicePointManager.SecurityProtocol unset, or set it to SecurityProtocolType.SystemDefault.
  • Avoid the SslStream overloads that take an explicit SslProtocols value. If you must use one, pass SslProtocols.SystemDefault.
  • Never use SslProtocols.Default. Microsoft warns it sets SSL 3.0 and TLS 1.0, both obsolete.

Hard-coding a lower version also blocks TLS 1.3 even where the OS supports it. If an app targets an old .NET Framework version, two machine-wide registry values (DWORD, under HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319, and under WOW6432Node for 32-bit apps) set the safe behavior: SystemDefaultTlsVersions = 1 lets the OS choose the protocol, and SchUseStrongCrypto = 1 turns on strong cryptography for outgoing connections. Microsoft notes these keys do not exist by default and affect every application on the machine.

HSTS for websites

HSTS is not a TLS setting on the server. It is a response header that tells browsers to use only HTTPS for your domain. Per MDN, a common value is:

Strict-Transport-Security: max-age=31536000; includeSubDomains

max-age is in seconds, so 31536000 is one year. Points that catch people out:

  • Browsers ignore the header when it arrives over plain HTTP. It must be sent over HTTPS.
  • It does not apply on the first visit. The browser has to receive the header once before it takes effect.
  • With HSTS active, users cannot click through certificate errors on that domain. An expired certificate becomes a hard failure.
  • To remove it, send max-age=0 over HTTPS. Simply dropping the header leaves the existing policy in place until it expires.
  • Adding preload opts into browser preload lists and requires max-age of at least 31536000 and includeSubDomains. Because includeSubDomains covers every subdomain, confirm they all serve valid HTTPS first.

OCSP stapling

OCSP stapling lets the server send the current revocation status of its certificate during the handshake, so clients do not each query the certificate authority. On Windows, Microsoft says OCSP support is on by default for IIS sites with a simple SSL/TLS binding, but not for bindings that require Server Name Indication or use the Centralized Certificate Store. For those, you can add the DWORD EnableOcspStaplingForSni = 1 under the SCHANNEL key. Microsoft notes this has a potential performance impact. To inspect the certificate a server presents, see how to check an SSL certificate.

If a connection fails after you change a setting

A client that only supports a version or cipher suite you removed will fail the handshake, often with a "protocol version" or "handshake failure" message. Revert the one setting you changed, restart the affected service, and test again. If the client is an old device, replace or update it instead of re-enabling TLS 1.0 on a shared server. Remember the timing rules above: cipher order changes need a reboot, and version changes may need the service restarted before they apply.

Frequently asked questions

What are the recommended TLS security settings?
Allow TLS 1.2 and TLS 1.3 and nothing older. RFC 8996 says TLS 1.0 and TLS 1.1 MUST NOT be used, and SSL 3.0 is older still. Leave cipher suites and protocol selection at the operating system defaults unless you have a specific reason to change them, and send a Strict-Transport-Security header on websites.
Should I edit the Schannel registry to harden TLS on Windows?
Only if you have to. Microsoft's documentation recommends system defaults over imposing version restrictions, and says to use Group Policy or other Windows tools instead of editing the registry when possible. Disabling a version can break connections with remote peers that still need it.
Do TLS settings changes on Windows need a restart?
It depends on the setting. Cipher suite order changes take effect on the next boot. Protocol version changes apply to new credential handles, and Microsoft notes that an application or service restart might be needed because many services reuse their handles.
Does HSTS replace TLS settings?
No. HSTS only tells browsers to use HTTPS for your domain. The TLS versions and cipher suites your server accepts are configured separately on the server.

Sources