Do not check a pinned certificate's dates
Docs / docs (push) Successful in 32s
Playwright Tests / test-playwright (1, 2) (push) Failing after 6m58s
Playwright Tests / test-playwright (2, 2) (push) Failing after 2m33s
pre-commit / pre-commit (push) Failing after 3m1s
Test Backend / test-backend (push) Failing after 3m13s
Compose Smoke Test / test-compose (push) Successful in 31s
Playwright Tests / merge-reports (push) Successful in 1m34s
Docs / docs (push) Successful in 32s
Playwright Tests / test-playwright (1, 2) (push) Failing after 6m58s
Playwright Tests / test-playwright (2, 2) (push) Failing after 2m33s
pre-commit / pre-commit (push) Failing after 3m1s
Test Backend / test-backend (push) Failing after 3m13s
Compose Smoke Test / test-compose (push) Successful in 31s
Playwright Tests / merge-reports (push) Successful in 1m34s
A pin trusts one exact certificate, so an expired one or an engine clock that is off no longer locks a device out (X509_V_FLAG_NO_CHECK_TIME). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
@@ -83,6 +83,10 @@ def context_for(pem: str) -> ssl.SSLContext:
|
||||
context.check_hostname = False
|
||||
# The pinned certificate is the trust anchor, not a chain up to a root.
|
||||
context.verify_flags |= ssl.VERIFY_X509_PARTIAL_CHAIN
|
||||
# X509_V_FLAG_NO_CHECK_TIME, which `ssl` has no name for. A pin trusts one
|
||||
# exact certificate, so its dates add nothing, and a device's certificate
|
||||
# that expired, or a clock that is off, would otherwise lock it out.
|
||||
context.verify_flags |= 0x200000
|
||||
context.load_verify_locations(cadata=pem)
|
||||
return context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user