Skip to content

Commit

Permalink
[1.26] Add server_hostname to SSL_KEYWORDS
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani committed Jan 20, 2022
1 parent b1f60e4 commit f1d40fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/urllib3/poolmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"ca_cert_dir",
"ssl_context",
"key_password",
"server_hostname",
)

# All known keyword arguments that could be provided to the pool manager, its
Expand Down
5 changes: 5 additions & 0 deletions test/with_dummyserver/test_poolmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ def test_http_with_ssl_keywords(self):
r = http.request("GET", "http://%s:%s/" % (self.host, self.port))
assert r.status == 200

def test_http_with_server_hostname(self):
with PoolManager(server_hostname="example.com") as http:
r = http.request("GET", "http://%s:%s/" % (self.host, self.port))
assert r.status == 200

def test_http_with_ca_cert_dir(self):
with PoolManager(ca_certs="REQUIRED", ca_cert_dir="/nosuchdir") as http:
r = http.request("GET", "http://%s:%s/" % (self.host, self.port))
Expand Down

0 comments on commit f1d40fd

Please sign in to comment.