Fix for #30: options for certificate validation and client certs. #315

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@sciyoshi

Quick fix for issue #30. Note that this doesn't do hostname matching when verifying, although this is an issue in urllib3 - maybe it should use backports.ssl_match_hostname if available.

For example, you can set the global ca_certs and enable cert verification with

import requests

requests.defaults.defaults['verify_cert'] = True
requests.defaults.defaults['ca_certs'] = '/etc/ssl/certs/ca-certificates.crt'
Fix for #30: options for certificate validation and client certs.
Note that this doesn't do hostname matching when verifying,
although this is an issue in urllib3 - maybe it should use
[`backports.ssl_match_hostname`][1] if available.

[1]: http://pypi.python.org/pypi/backports.ssl_match_hostname/
@kennethreitz

This comment has been minimized.

Show comment
Hide comment
@kennethreitz

kennethreitz Dec 21, 2011

Member

Awesome!

Those default dicts shouldn't be touched by any users. There needs to be a better API for this.

Member

kennethreitz commented Dec 21, 2011

Awesome!

Those default dicts shouldn't be touched by any users. There needs to be a better API for this.

@piotr-dobrogost

This comment has been minimized.

Show comment
Hide comment
@piotr-dobrogost

piotr-dobrogost Dec 21, 2011

Contributor

Those default dicts shouldn't be touched by any users.

This would be not quite pythonic I guess :)

Contributor

piotr-dobrogost commented Dec 21, 2011

Those default dicts shouldn't be touched by any users.

This would be not quite pythonic I guess :)

@kennethreitz

This comment has been minimized.

Show comment
Hide comment
@kennethreitz

kennethreitz Dec 22, 2011

Member
@kennethreitz

This comment has been minimized.

Show comment
Hide comment
@kennethreitz

kennethreitz Dec 28, 2011

Member

Requests v0.8.8 was just released that includes ssl verification!

http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

Member

kennethreitz commented Dec 28, 2011

Requests v0.8.8 was just released that includes ssl verification!

http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment