Skip to content

[BUG] Regulatory Compliance API uses deprecated numbers.ie1.twilio.com hostname causing SSL certificate mismatch when region='ie1' #924

@lucassing

Description

@lucassing

Describe the bug

When initializing the Twilio client with region='ie1', the Regulatory Compliance API (numbers.v2.regulatory_compliance) resolves to https://numbers.ie1.twilio.com. However, this hostname is no longer present in the SSL certificate's SANs, causing SSLCertVerificationError: certificate verify failed: Hostname mismatch.

Code snippet

from twilio.rest import Client

client = Client(account_sid, auth_token, region='ie1')
# This hits https://numbers.ie1.twilio.com and fails SSL verification
regulations = client.numbers.v2.regulatory_compliance.regulations.list()

Actual behavior

SSLError: HTTPSConnectionPool(host='numbers.ie1.twilio.com', port=443): 
Max retries exceeded with url: /v2/RegulatoryCompliance/Regulations...
Caused by SSLError(SSLCertVerificationError(1, 
"[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, 
certificate is not valid for 'numbers.ie1.twilio.com'"))

Expected behavior

The SDK should route to the new localized domain pattern or at minimum use a hostname with a valid certificate.

twilio-python version

9.10.4

Python version

3.11.9

Logs or error messages

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugbug in the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions