Remove unused HTTPSConnection.connect()
Unverified connections also go through VerifiedHTTPSConnection.
MODIFY
src/urllib3/connection.py
src/urllib3/connection.py
@@ -251,40 +251,6 @@ class HTTPSConnection(HTTPConnection):
# 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):
"""

Remove unused HTTPSConnection.connect()

Unverified connections also go through VerifiedHTTPSConnection.