Repository navigation
Refuse TLS chains containing the distrusted eMudhra intermediates - #979
shrutiburman wants to merge 1 commit into
Conversation
42dd6e0 to
d9531f9
Compare
d9531f9 to
059886b
Compare
| return | ||
| if contains_distrusted(chain, distrusted): | ||
| raise DistrustedIntermediateError( | ||
| "Certificate chain contains a distrusted intermediate certificate" |
There was a problem hiding this comment.
Suggestion: use this exact message so all SDKs and the CLI match: Certificate chain which you are using contains a distrusted intermediate certificate
twilio-node (#1223), twilio-csharp (#861) and twilio-cli (#738) already use it. One string lets customers, support and docs search for the same error in every language.
| return | ||
| if contains_distrusted(chain, distrusted): | ||
| raise DistrustedIntermediateError( | ||
| "Certificate chain contains a distrusted intermediate certificate" |
There was a problem hiding this comment.
Suggestion: use this exact message so all SDKs and the CLI match: Certificate chain which you are using contains a distrusted intermediate certificate
twilio-node (#1223), twilio-csharp (#861) and twilio-cli (#738) already use it. One string lets customers, support and docs search for the same error in every language.
How: change the DistrustedIntermediateError message here. The test uses assertIn("distrusted intermediate", ...), so it should still pass.

What
Ports the twilio-java
distrust-emudhra-intermediatescheck to twilio-python. A connection is refused if any certificate in its TLS chain has an SPKI SHA-256 hash among the 8 distrusted intermediates (same list as Go 1.27.3 / 1.26.10, CVE-2026-111943, golang/go#82345).twilio/http/distrusted_intermediates.py:DistrustedIntermediatesAdapterandmount_distrusted_intermediates_check(session).TwilioHttpClientandValidationClientapply it by default. A customrequestssession has to opt in (README section added).setup.pyaddspyOpenSSLforpython_version < "3.10".Behaviour differs by Python version