I am trying to send a custom sms to a user via twilio but getting ssl error
This is how I am doing. When I try this code
message = twilio_client.messages.create(
body=f"Your OTP is: {new_otp}",
from_=settings.TWILIO_PHONE_NUMBER,
to=to_phone_number
)
I get the following error after this running this part of the code
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.ap1.twilio.com', port=443): Max retries exceeded with url: /2010-04-01/Accounts/AC871e4afa1d16f5f1a892a7af250eabf2/Messages.json (Caused by SSLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'api.ap1.twilio.com'. (_ssl.c:1007)")))
based on online research i checked the url that this part is refering that is
https://api.ap1.twilio.com/2010-04-01/Accounts/AC871e4afa1d16f5f1a892a7af250eabf2/Messages.json
but when I check with postman it gives me 404 not found response