Repository navigation
What's New
- Encrypted Client Hello (RFC 9849) for TLS 1.3 (#23, #26)
TlsLib.Compliance: FIPS 140-3 and CNSA 1.0 policies; attests the Windows CNG module, other platforms report an unattested module (#400)- Opt-in OS-native crypto provider (Windows CNG) (#28, #30)
- Opt-in OS-native live revocation on Windows and Apple, for clients and servers, including mutual TLS (#42-#44)
TSystemTrustRoots: trust host roots beside the OS roots, or instead of them, including inside the OS verifier on Windows, macOS, iOS and Android; OS distrust still applies (#399)SecP256r1MLKEM768hybrid group and a certificate chain-algorithm policy (#31)- TLS 1.2 pre-shared keys (ECDHE_PSK) (#399)
TlsLib.Net: own socket layer, TCP connector and listener, and HTTP fetcher; no RTL HTTP client (#399)- mORMot, Synapse, Indy and fcl-net adapters read the host's PKCS#12 and in-memory certificate properties where the host has them, and honour host cipher lists (#399)
- Handshake failures report the specific reason;
TTlsErroraddsOrigin(local, peer or transport) and the peer's raw alert byte (#399) - Builder: explicit cipher-suite list,
record_size_limit, key log, SNI mode, resumption scope, monotonic clock - RFC 9846 conformance for TLS 1.3 (#399)
Security Hardening
- Fixed three certificate-trust bypasses: pin evaluation, Windows and macOS anchor harvest (#47)
- Fixed a cross-config resumption bypass; added opt-in client reverify-on-resume (#34, #36, #39)
- Trust anchor name constraints are enforced on every OS trust back end (#412)
- Chain algorithm and strength policy apply over OS trust delegates (#38)
- A peer's end-entity certificate must not be a CA, unless it is itself a trust anchor (#399)
- Inbound framing is bounded and engine entry points fail closed (#48)
- TLS 1.2 read epoch gated on ChangeCipherSpec (#45)
- The long-lived ECDH scalar for the ECH recipient key is blinded (#50)
- A resumption chain ends seven days after the handshake that authenticated it (#399)
- Chain failures send the right alert:
decrypt_errorfor a bad signature,certificate_unknownfor an unknown critical extension or name constraint violation (#411)
Fixes
- Nil dereferences and the errno read that crashed on Android (#408)
- Keying-material export in TLS 1.3 half-RTT (#46)
- Apple chain verification date (#41)
- fcl-net adapter waits with poll/select before every receive, so a silent peer cannot block it where the receive timeout is ignored; application reads time out with
ETlsReadTimeout(#399) - NetBSD, OpenBSD and DragonFly
sockaddr_inlength byte; NetBSD clock symbol on 32-bit CPUs (#403, #404)
Breaking Changes
Setup
| Before (v1.0) | Now |
|---|---|
TTlsPresets.Compatible/Hardened/Strict(provider) |
(crypto, pkix): certificate parsing, path validation and revocation moved from ICryptoProvider to IPkixProvider (TDefaultPkixProvider) |
TTlsConfigBuilder.Create(provider) |
Create(crypto, pkix, profile) |
Config.Provider |
Config.Crypto and Config.Pkix |
TCryptoProviderOverrides |
Removed; pass the facets to TDefaultCryptoProvider.Create |
Trust and verification
| Before (v1.0) | Now |
|---|---|
WithTrustStore(store) |
WithServerVerification(TServerVerification.WebPki(store).Build) |
WithTrustAnchors(pem) |
WithServerVerification(TServerVerification.WebPki(pem).Build) |
WithCertificateVerifier(v) |
WithServerVerification(TServerVerification.Custom(v)), or TServerVerification.VerifierSource(src).Build for a source that owns its roots (the OS verifier) |
ICertificateVerifier.Verify(chain, host, staple, out alert) |
IServerCertificateVerifier.VerifyServerCertificate(chain, serverName: TServerName, staple, out verified: TVerifiedChain, out alert); servers use IClientCertificateVerifier.VerifyClientCertificate |
WithDangerousInsecureSkipVerify(True) |
WithServerVerification(TServerVerification.DangerousSkip) |
WithNameCheck(False) |
WithDangerousDisableServerNameCheck |
WithIntermediateCertificates(data) |
.WithIntermediateCertificates(data) on the verification builder, before .Build |
WithRevocation(posture) |
.WithRevocation(posture) on the verification builder, before .Build |
| The same trust methods on the server builder (client certificates) | WithClientVerification(TClientVerification.WebPki(...) / VerifierSource / Custom / DangerousSkip) |
TTlsCertificateVerifyCallback(AChain, AHostName) |
(APresented, AValidated, AHostName): everything the peer sent, and the validated path (nil under DangerousSkip). It still runs last and can only reject |
TSystemTrust.WithSystemTrust(clientBuilder, provider, mode) |
clientBuilder.WithServerVerification(TSystemTrust.ServerVerification(pkix, mode, TSystemTrustRoots.OsRoots).Build) |
TSystemTrust.WithSystemTrust(serverBuilder, ...) (OS roots as the mTLS client CA) |
Removed. System trust verifies server certificates only. Supply the client CA with WithClientVerification(TClientVerification.WebPki(store)). To run the OS verifier over your own private CA, use TOSSystemTrust.ClientVerifierSource |
TOSSystemTrust.DelegateVerifier |
TOSSystemTrust.ServerVerifierSource |
TWindowsAnchorStore, TUnixAnchorStore, TAppleAnchorStore, TFileSystemAnchorStore, TUnionTrustAnchorStore |
Removed; use TOSSystemTrust and TTrustAnchorStore.Union |
ITrustAnchorStore (unit TlpICertificateTrust), only RootCertificates |
Unit TlpITrustAnchorStore; custom stores also implement AnchorCount, IsAnchor, DistrustedCertificates, IsDistrusted |
TSystemTrustMode.Default harvested OS roots on Windows and macOS |
Uses the OS verifier there (Linux, BSD and Solaris still harvest). Pass TSystemTrustMode.Anchors for the old behaviour |
IHttpFetcher.Get / Post |
Take an AMaxBytes cap |
TSocketHttpFetcher over the RTL HTTP clients |
Own HTTP/1.1 client over TlsLib.Net, configured by TSocketHttpFetcherSettings (Clock, Resolver, DestinationPolicy, TlsConfig, ProxyHost, ProxyPort). https needs a TlsConfig, a proxy is explicit, redirects and IPv6 responders fail |
Credentials and builder
| Before (v1.0) | Now |
|---|---|
WithCredentialPkcs12(data, pw) |
WithCredential(TTlsCredential.LoadPkcs12(crypto, data, pw)) |
WithCredential(chain, key[, pw]) and WithSniCredential(host, chain, key[, pw]) |
WithCredential(TTlsCredential.Load(crypto, pkix, chain, key[, pw])); the same for WithSniCredential |
WithAlpnProtocols(array of string) |
WithAlpnProtocols(array of TBytes) |
WithAsyncCertificateVerdict(True, ms) |
WithAsyncCertificateVerdict(ms) |
WithExternalPreSharedKeys, WithExternalPskRequired, WithTicketCount on the endpoint builder |
On .Tls13 |
ICipherSuiteRegistry / ISignatureSchemeRegistry / INamedGroupRegistry had Add and Prune |
Registries are read-only, so a built config can't change underneath you. To prune or add entries, use ToBuilder, change it, then Build |
Engine and sessions
| Before (v1.0) | Now |
|---|---|
engine.NegotiatedVersion, NegotiatedCipherSuite, NegotiatedGroup, PeerCertificates, IsResumed, ... |
engine.ConnectionInfo |
ExportKeyingMaterial(label, context, useContext, len) |
ExportKeyingMaterial(label, len) or (label, context, len) |
RequestKeyUpdate(Boolean) |
RequestKeyUpdate(TKeyUpdateRequest) |
Rejected 0-RTT replayed as 1-RTT; accepted 0-RTT read with ReadAppData |
Rejected 0-RTT is discarded (WriteEarlyData returns what was accepted); accepted 0-RTT is read with ReadEarlyData |
ISessionTicketKeyManager.Rotate |
Rotate is on IRotatingTicketKeyManager, which TStekTicketKeyManager implements. TFleetTicketKeyManager shares a key across servers |
| Session tickets issued by v1.0 | Rejected; the client falls back to one full handshake |
Defaults and limits
| Before (v1.0) | Now |
|---|---|
TCertificateChainLimits.MaxChainLength; 256 KiB chain default |
MaxChainCertificates (default 16); the whole Certificate message defaults to 64 KiB |
| Presets | Compatible prefers SecP256r1MLKEM768; Hardened and Strict request an OCSP staple; Strict also offers secp256r1 and caps chains at 8 certificates, 16 KiB each, 32 KiB in total |
Adapter cipher list (CipherList, Ciphers) ignored |
Honoured; a cipher-string expression such as HIGH:!aNULL, or a suite TlsLib does not implement, raises. Leave it empty or DEFAULT to keep the preset |
| TLS 1.2 sessions without Extended Master Secret resumed | Declined by default; Tls12.WithNonEmsResumption(Resume) to allow |
| Settings that had no effect were accepted | Build raises (for example client verification on a server that requests no client certificate) |
Many public interfaces changed shape, some under their old GUID. Rebuild every custom implementation against v1.1. Projects that use TSocketHttpFetcher must add the new TlsLib.Net package (TlsLib.Net/src).
Other
- Requires CryptoLib4Pascal 3.5
- Interop harness runs on every non-emulated CI leg (#405); Android and Delphi mobile test hosts (#409, #410, #413); Delphi
TESTINSIGHTtest build (#407)
Full Changelog: v1.0...v1.1