|
19 | 19 |
|
20 | 20 |
|
21 | 21 | try: # We shouldn't do this, it is private. Only for chain extraction check. We should find another way. |
22 | | - from _ssl import Certificate # type: ignore[import-not-found] |
| 22 | + from _ssl import Certificate |
23 | 23 | except (ImportError, AttributeError): |
24 | | - Certificate = None |
| 24 | + Certificate = None # type: ignore[misc,assignment] |
25 | 25 |
|
26 | 26 | from .._collections import HTTPHeaderDict |
27 | 27 | from .._constant import ( |
@@ -336,8 +336,8 @@ def _custom_tls( |
336 | 336 | cert_reqs: int | str | None = None, |
337 | 337 | ) -> bool: |
338 | 338 | """Meant to support TLS over QUIC meanwhile cpython does not ship with its native implementation.""" |
339 | | - if self._svn != HttpVersion.h3: |
340 | | - return NotImplemented |
| 339 | + if self._svn is not HttpVersion.h3: |
| 340 | + return False |
341 | 341 |
|
342 | 342 | cert_use_common_name = False |
343 | 343 |
|
@@ -574,7 +574,7 @@ def _post_conn(self) -> None: |
574 | 574 | self.conn_info.issuer_certificate_der = ( |
575 | 575 | ssl.PEM_cert_to_DER_cert(chain[1].public_bytes()) |
576 | 576 | ) |
577 | | - self.conn_info.issuer_certificate_dict = chain[1].get_info() |
| 577 | + self.conn_info.issuer_certificate_dict = chain[1].get_info() # type: ignore[assignment] |
578 | 578 |
|
579 | 579 | elif hasattr(self.sock, "getpeercert"): |
580 | 580 | self.conn_info.certificate_der = self.sock.getpeercert(binary_form=True) |
@@ -608,7 +608,7 @@ def _post_conn(self) -> None: |
608 | 608 | self.conn_info.issuer_certificate_der = ( |
609 | 609 | ssl.PEM_cert_to_DER_cert(chain[1].public_bytes()) |
610 | 610 | ) |
611 | | - self.conn_info.issuer_certificate_dict = chain[1].get_info() |
| 611 | + self.conn_info.issuer_certificate_dict = chain[1].get_info() # type: ignore[assignment] |
612 | 612 |
|
613 | 613 | if cipher_tuple: |
614 | 614 | self.conn_info.cipher = cipher_tuple[0] |
|
0 commit comments