feat: TLS certificates by trust on first use #74

Merged
christianmanivong merged 4 commits from feat/tls-fingerprint-tofu into main 2026-11-01 23:21:04 +00:00
4 Commits
Author SHA1 Message Date
christianmanivong 63039ce758 fix(types): the adapter's ignore holds with and without requests' stubs
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 57s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / test (3.12) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 53s
CI / driver (pull_request) Successful in 2m12s
driver / publish (pull_request) Skipped
CI installs types-requests, so HTTPAdapter is typed there and the
ignore for subclassing an untyped base is unused; locally it is needed.
2026-11-02 00:15:55 +01:00
christianmanivong 516fb18c0e Merge remote-tracking branch 'origin/main' into feat/tls-fingerprint-tofu
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 15s
driver / test (3.13) (pull_request) Successful in 1m14s
driver / types (pull_request) Failing after 1m35s
driver / test (3.12) (pull_request) Successful in 1m27s
driver / lowest (pull_request) Successful in 34s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Failing after 2m34s
driver / publish (pull_request) Skipped
# Conflicts:
#	CHANGELOG.md
2026-11-02 00:06:53 +01:00
christianmanivong c9571d59f1 Merge remote-tracking branch 'origin/main' into feat/tls-fingerprint-tofu
# Conflicts:
#	CHANGELOG.md
2026-11-01 23:01:38 +01:00
christianmanivong 46c1c9dc4e feat: TLS certificates by trust on first use
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 20s
driver / types (pull_request) Failing after 1m10s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Failing after 3m4s
driver / publish (pull_request) Skipped
Devices ship self-signed certificates, so a driver either fails the CA
check on every one of them or turns verification off and sends the
login to whatever answers on the address. tls_certificates pins the
certificate by its SHA-256 fingerprint instead, shaped like
ssh_host_keys: the caller passes the fingerprint to expect by port
(optional_args["tls_fingerprints"]), the driver refuses any other
certificate before a request carries credentials, and every certificate
seen goes to optional_args["tls_certificate_observer"]. Without a
fingerprint the first certificate is accepted.

CertificateCheck checks the certificate in a handshake of its own, then
pins a requests session to it (urllib3's assert_fingerprint, direct and
through a proxy), so no other host can step in between the check and
the login.

Refs NAPALM/napalm-hpe-aruba-procurve#17
2026-11-01 22:13:20 +01:00