2020-03-14 09:47:33 +01:00
|
|
|
#!/usr/bin/python
|
2020-03-13 20:10:24 +01:00
|
|
|
|
|
|
|
import ssl
|
|
|
|
|
2020-04-06 10:45:46 +02:00
|
|
|
with open('/etc/ckan-datapusher/add-ca-cert.env') as f:
|
|
|
|
env = dict(tuple(line.split('=')) for line in f.read().splitlines())
|
|
|
|
|
|
|
|
cert = ssl.get_server_certificate((env['DOMAIN'], env['PORT']))
|
2020-03-14 09:47:33 +01:00
|
|
|
with open('/usr/lib/python2.7/site-packages/requests/cacert.pem', 'a') as f:
|
2020-03-13 20:10:24 +01:00
|
|
|
f.write(cert)
|
2020-03-14 11:36:58 +01:00
|
|
|
|
|
|
|
with open('/usr/lib/python2.7/site-packages/certifi/cacert.pem', 'a') as f:
|
|
|
|
f.write(cert)
|