Class SpkiPinningClientTlsStrategy

All Implemented Interfaces:
TlsSocketStrategy, org.apache.hc.core5.http.nio.ssl.TlsStrategy

@Contract(threading=IMMUTABLE) public final class SpkiPinningClientTlsStrategy extends DefaultClientTlsStrategy

SPKI pinning decorator for client-side TLS.

This strategy enforces one or more sha256/<base64(SPKI)> pins for a given host or single-label wildcard (e.g. *.example.com) after the standard trust manager and hostname verification succeed. Pins are matched against the SubjectPublicKeyInfo (SPKI) of any certificate in the peer chain.

Host matching is performed on the IDNA ASCII (Punycode) lowercase form. Wildcards are single-label only (e.g. *.example.com matches a.example.com but not a.b.example.com).

Warning: Certificate pinning increases operational risk. Always ship at least two pins (active + backup) and keep normal PKI + hostname verification enabled.

Thread-safety: immutable and thread-safe.

Since:
5.6