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

Rename VerifiedHTTPSConnection #1805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ master (dev)
* Raise ``ValueError`` if control characters are given in
the ``method`` parameter of ``HTTPConnection.request()`` (Pull #1800)

* Rename ``VerifiedHTTPSConnection`` to ``HTTPSConnection`` (Pull #1805)


1.25.8 (2020-01-20)
-------------------
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,8 @@ In chronological order:
* Benno Rice <benno@jeamland.net>
* Allow cadata parameter to be passed to underlying ``SSLContext.load_verify_locations()``.

* Keiichi Kobayashi <abok.1k@gmail.com>
* Rename VerifiedHTTPSConnection to HTTPSConnection

* [Your name or handle] <[email or website]>
* [Brief summary of your changes]
30 changes: 10 additions & 20 deletions src/urllib3/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ def request_chunked(self, method, url, body=None, headers=None):
class HTTPSConnection(HTTPConnection):
default_port = port_by_scheme["https"]

cert_reqs = None
ca_certs = None
ca_cert_dir = None
ca_cert_data = None
ssl_version = None
assert_fingerprint = None

def __init__(
self,
Expand Down Expand Up @@ -265,20 +270,6 @@ def __init__(
# HTTPS requests to go out as HTTP. (See Issue #356)
self._protocol = "https"


class VerifiedHTTPSConnection(HTTPSConnection):
"""
Based on httplib.HTTPSConnection but wraps the socket with
SSL certification.
"""

cert_reqs = None
ca_certs = None
ca_cert_dir = None
ca_cert_data = None
ssl_version = None
assert_fingerprint = None

def set_cert(
self,
key_file=None,
Expand Down Expand Up @@ -425,9 +416,8 @@ def _match_hostname(cert, asserted_hostname):
raise


if ssl:
# Make a copy for testing.
UnverifiedHTTPSConnection = HTTPSConnection
HTTPSConnection = VerifiedHTTPSConnection
else:
HTTPSConnection = DummyConnection
if not ssl:
HTTPSConnection = DummyConnection # noqa: F811


VerifiedHTTPSConnection = HTTPSConnection