Skip to content

Commit

Permalink
Remove unused HTTPSConnection.connect()
Browse files Browse the repository at this point in the history
Unverified connections also go through VerifiedHTTPSConnection.
  • Loading branch information
pquentin committed Nov 8, 2019
1 parent 18f00ce commit c587125
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/urllib3/connection.py
Expand Up @@ -251,40 +251,6 @@ def __init__(
# HTTPS requests to go out as HTTP. (See Issue #356)
self._protocol = "https"

def connect(self):
conn = self._new_conn()
self._prepare_conn(conn)

# Wrap socket using verification with the root certs in
# trusted_root_certs
default_ssl_context = False
if self.ssl_context is None:
default_ssl_context = True
self.ssl_context = create_urllib3_context(
ssl_version=resolve_ssl_version(self.ssl_version),
cert_reqs=resolve_cert_reqs(self.cert_reqs),
)

# Try to load OS default certs if none are given.
# Works well on Windows (requires Python3.4+)
context = self.ssl_context
if (
not self.ca_certs
and not self.ca_cert_dir
and default_ssl_context
and hasattr(context, "load_default_certs")
):
context.load_default_certs()

self.sock = ssl_wrap_socket(
sock=conn,
keyfile=self.key_file,
certfile=self.cert_file,
key_password=self.key_password,
ssl_context=self.ssl_context,
server_hostname=self.server_hostname,
)


class VerifiedHTTPSConnection(HTTPSConnection):
"""
Expand Down

0 comments on commit c587125

Please sign in to comment.