A trusted certificate still needs the right name
Certificate-chain validation and service identity must agree.
Keep both checks
Python 3.12’s create_default_context supplies client-oriented certificate verification defaults. The ssl documentation distinguishes certificate validation from hostname checking; CERT_REQUIRED alone does not provide hostname matching. Client connections need the intended server name and an appropriate trust configuration.
When a service uses a private certificate authority, configure that trust deliberately. Disabling verification to accommodate a private issuer removes more than the issuer mismatch and leaves the original identity question unanswered.
Exercise the wrong name
For an original local test plan, prepare a controlled service certificate for one test hostname. A client configured for that hostname and trust root should connect; a client expecting a different hostname should fail. Test an untrusted issuer separately so each failure has a clear explanation.
Use a test certificate authority and disposable endpoints. Record the runtime version, trust configuration and requested hostname without recording private keys. A successful encrypted connection by itself does not demonstrate that the client authenticated the intended service.
Diagnose before relaxing
Our suggested incident checklist distinguishes expiry, missing intermediates, unexpected trust roots and name mismatch. Capture the error category and deployed configuration before changing settings. Where a proxy terminates TLS, document which hop each check covers; success on the first hop does not verify a later connection. Keep a regression case for the failure that prompted the repair so a future workaround cannot silently remove the identity check.