(self, tmp_path: Path)
| 278 | assert not warn.called, warn.call_args_list |
| 279 | |
| 280 | def test_ca_dir_verified(self, tmp_path: Path) -> None: |
| 281 | # OpenSSL looks up certificates by the hash for their name, see c_rehash |
| 282 | # TODO infer the bytes using `cryptography.x509.Name.public_bytes`. |
| 283 | # https://github.com/pyca/cryptography/pull/3236 |
| 284 | shutil.copyfile(DEFAULT_CA, str(tmp_path / "81deb5f7.0")) |
| 285 | |
| 286 | with HTTPSConnectionPool( |
| 287 | self.host, |
| 288 | self.port, |
| 289 | cert_reqs="CERT_REQUIRED", |
| 290 | ca_cert_dir=str(tmp_path), |
| 291 | ssl_minimum_version=self.tls_version(), |
| 292 | ) as https_pool: |
| 293 | with contextlib.closing(https_pool._new_conn()) as conn: |
| 294 | assert conn.__class__ == VerifiedHTTPSConnection |
| 295 | |
| 296 | with warnings.catch_warnings(record=True) as w: |
| 297 | r = https_pool.request("GET", "/") |
| 298 | assert r.status == 200 |
| 299 | |
| 300 | assert [str(wm) for wm in w] == [] |
| 301 | |
| 302 | def test_invalid_common_name(self) -> None: |
| 303 | with HTTPSConnectionPool( |
nothing calls this directly
no test coverage detected