ca_certs in httplib2
KristofMerey opened this issue · 0 comments
KristofMerey commented
Because of new browser rules, I had to install local certificate authority and make localhost available via https for testing. I think it will be more common in the future. For using the locally-issued certificate, httplib2 has a parameter ca_certs; however, it cannot be available through pylti. I solved the problem with monkey patching; however, it seems awkward:
import httplib2
old_init = httplib2.Http.__init__
def new_init(self, *args, **kwargs):
"""Call the original __init__ function with the certificate."""
old_init(self, *args, **kwargs, ca_certs=ROOT_CERTIFICATE_PATH)
httplib2.Http.__init__ = new_init
Maybe PYLTI_CONFIG
could take ca_certs and pass to httplib2:
app.config['PYLTI_CONFIG'] = {
'consumers': {CONSUMER_KEY: {'secret': CONSUMER_SECRET}},
'ca_certs': ROOT_CERTIFICATE_PATH,
}