(self)
| 443 | https_pool.request("GET", "/") |
| 444 | |
| 445 | def test_server_hostname(self) -> None: |
| 446 | with HTTPSConnectionPool( |
| 447 | "127.0.0.1", |
| 448 | self.port, |
| 449 | cert_reqs="CERT_REQUIRED", |
| 450 | ca_certs=DEFAULT_CA, |
| 451 | server_hostname="localhost", |
| 452 | ssl_minimum_version=self.tls_version(), |
| 453 | ) as https_pool: |
| 454 | conn = https_pool._new_conn() |
| 455 | conn.request("GET", "/") |
| 456 | |
| 457 | # Assert the wrapping socket is using the passed-through SNI name. |
| 458 | # pyopenssl doesn't let you pull the server_hostname back off the |
| 459 | # socket, so only add this assertion if the attribute is there (i.e. |
| 460 | # the python ssl module). |
| 461 | if hasattr(conn.sock, "server_hostname"): # type: ignore[attr-defined] |
| 462 | assert conn.sock.server_hostname == "localhost" # type: ignore[attr-defined] |
| 463 | conn.getresponse().close() |
| 464 | conn.close() |
| 465 | |
| 466 | def test_assert_fingerprint_md5(self) -> None: |
| 467 | with HTTPSConnectionPool( |
nothing calls this directly
no test coverage detected