Skip to content

Fix #173: HTTPS request doesn't work when disable_ssl_certificate_validation=True#288

Closed
r14c wants to merge 2 commits intojcgregorio:masterfrom
zulumarketing:master
Closed

Fix #173: HTTPS request doesn't work when disable_ssl_certificate_validation=True#288
r14c wants to merge 2 commits intojcgregorio:masterfrom
zulumarketing:master

Conversation

@r14c
Copy link
Copy Markdown

@r14c r14c commented Nov 25, 2014

Sets SSLContext.verify_mode to ssl.CERT_OPTIONAL if disable_ssl_certificate_validation is True otherwise it is set to ssl.CERT_REQUIRED.

Sets `SSLContext.verify_mode` to `ssl.CERT_OPTIONAL` if `disable_ssl_certificate_validation` is `True` otherwise it is set to `ssl.CERT_REQUIRED`.
Comment thread python3/httplib2/__init__.py Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this causes Python 3.1 to always raise an exception, even when certification validation is explicitly not disabled, - i.e. when disable_ssl_certificate_validation is enabled.

fwiw, there is another pending patch for this issue; pull #269 , which has bitrotted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayvdb you are totally right, I'll update the patch.

* `ssl.SSLContext` is new in Python 3.2 and all of the features
  used here are available from then on.
* The when using an `SSLContext` the `check_hostname` kwarg *requires*
  that `context.verify_mode` be set to **either** `ssl.CERT_REQUIRED`
  **or** `ssl.CERT_OPTIONAL`. `ssl.CERT_NONE` raises an exception.
@r14c r14c closed this Oct 10, 2024
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

Successfully merging this pull request may close these issues.

2 participants