8000 ca_certs in httplib2 · Issue #100 · mitodl/pylti · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ca_certs in httplib2 #100
Open
Open
@KristofMerey

Description

@KristofMerey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0