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

ca_certs in httplib2 #100

Open
KristofMerey opened this issue Aug 9, 2021 · 0 comments
Open

ca_certs in httplib2 #100

KristofMerey opened this issue Aug 9, 2021 · 0 comments

Comments

@KristofMerey
Copy link

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,
}
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