Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twilio TLS certificate is not accepted by the Cabot docker image, so SMS and phone call notifications do not work #719

Open
hontvari opened this issue May 24, 2024 · 1 comment

Comments

@hontvari
Copy link

This is the result of docker logs ...

ERROR 2024-05-24 20:08:45,905 models 20 140543222823720 Error sending twilio sms: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cabot_alert_twilio/models.py", line 79, in send_alert
    body=message,
  File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/sms_messages.py", line 167, in create
    return self.create_instance(kwargs)
  File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 365, in create_instance
    data=transform_params(body))
  File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 200, in request
    resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 152, in make_twilio_request
    resp = make_request(method, uri, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 117, in make_request
    resp, content = http.request(url, method, headers=headers, body=data)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1659, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1399, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1319, in _conn_request
    conn.connect()
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1092, in connect
    raise SSLHandshakeError(e)
SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

@hontvari
Copy link
Author

I was able to workaround the TLS issue by replacing the CA certificates within the image. I added the following lines to docker-compose-base.yml

    volumes:
      - /etc/ssl/certs/ca-certificates.crt:/usr/local/lib/python2.7/site-packages/requests/cacert.pem
      - /etc/ssl/certs/ca-certificates.crt:/usr/local/lib/python2.7/site-packages/httplib2/cacerts.txt
      - /etc/ssl/certs/ca-certificates.crt:/usr/local/lib/python2.7/site-packages/twilio/conf/cacert.pem

However, it still does not work, because Twilio discontinued the API which is used by Cabot:

web_1       | ERROR 2024-05-25 00:04:31,687 models 20 139827124976424 Error sending twilio sms: HTTP 410 error: This API is being discontinued. Please see https://support.twilio.com/hc/en-us/articles/223181028-Switching-from-SMS-Messages-resource-URI-to-Messages-resource-URI-
web_1       | Traceback (most recent call last):
web_1       |   File "/usr/local/lib/python2.7/site-packages/cabot_alert_twilio/models.py", line 79, in send_alert
web_1       |     body=message,
web_1       |   File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/sms_messages.py", line 167, in create
web_1       |     return self.create_instance(kwargs)
web_1       |   File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 365, in create_instance
web_1       |     data=transform_params(body))
web_1       |   File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 200, in request
web_1       |     resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
web_1       |   File "/usr/local/lib/python2.7/site-packages/twilio/rest/resources/base.py", line 164, in make_twilio_request
web_1       |     uri=resp.url, msg=message, code=code)
web_1       | TwilioRestException: HTTP 410 error: This API is being discontinued. Please see https://support.twilio.com/hc/en-us/articles/223181028-Switching-from-SMS-Messages-resource-URI-to-Messages-resource-URI-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant