Open silverl opened 9 years ago
This just started for me, also. I'm guessing something changed at Slack. If I hear back from them I'll update here.
It appears the httplib2 is failing to verify the wildcard certificate the Slack is using. Perhaps they started using it only recently? Don't know.
The following hack makes the code less secure, but it does work. It tells the httplib2 library to NOT verify the TLS certificate (which is generally a no-no).
Change line 127:
h = httplib2.Http(disable_ssl_certificate_validation=True)
Not sure what the "right" fix is yet.
Yuck. Seems like one solution is to download and bundle the signing root certificate, and tell the httplib2 where to find the PEM file.
https://pwnetics.wordpress.com/2012/02/06/ssl-certificate-verification-and-httplib2/
Is there a better http library available that is smarter about validating the certificate chain authority?
Bundling publicly available root certs is fragile, as Slack may choose a different certificate authority in the future and the whole mess breaks again.
It's my understanding the httplib2 is the prefered library for these types of transactions but I'll research a little more this afternoon.
Ok, here's the fix for me, on CentOS 6:
h = httplib2.Http(ca_certs='/etc/pki/tls/certs/ca-bundle.crt')
You need to instantiate httplib2 and let it know where your system-maintained bundle of CA certs resides. On CentOS, it's at that path. This could very well vary by OS and distro. It should likely be a config specified at the top or in a separate custom config file.
I'd recommend making a separate config file that can be added to .gitignore and included in your code. This will enable other users to pull the latest code without conflicts or other manual intervention required.
from Slack:
We applied OpenSSL security updates released yesterday, and this connection problem may be related (https://www.openssl.org/news/secadv_20150319.txt)
Applying available OpenSSL and/or Python updates to your server may help.
We may be able to help diagnose a little further if you can please execute openssl s_client -connect api.slack.com:443 on your server and provide the results back to us.
Thanks!
But there doesn't seem to be any new updates for CentOS 6.6 to catch up with this, so I may be expediting my migration to CentOS 7 and Zenoss 5 now.
I'm sure the openssl update is coming soon to CentOS 6. I was expecting it today. My CentOS 7 machine doesn't have it either. Both OSes are still supported.
FYI, openssl updates were available in the repos today for CentOS 6 and 7 when I checked. They released a backported fix into the 1.0.1e release.
You can check to see the CVEs were addressed via: rpm -q --changelog openssl | head
The fix I came up with to specify the ca_certs location is still required. I tried removing it and got the same old error.
Started getting this error just recently.