urllib3: move stubs for ssl_match_hostname around (#10117)

This commit is contained in:
Alex Waygood
2023-04-30 15:02:55 +01:00
committed by GitHub
parent 6f6b1c9135
commit e0db6d2edd
6 changed files with 10 additions and 13 deletions

View File

@@ -14,8 +14,6 @@ urllib3.connectionpool.HTTPConnectionPool.urlopen
urllib3.connectionpool.HTTPSConnectionPool.__init__
urllib3.connectionpool.VerifiedHTTPSConnection.__init__
urllib3.connectionpool.VerifiedHTTPSConnection.set_cert
urllib3.packages.ssl_match_hostname
urllib3.packages.ssl_match_hostname._implementation
urllib3.poolmanager.PoolManager.connection_from_host
urllib3.poolmanager.PoolManager.connection_from_url
urllib3.poolmanager.PoolManager.urlopen

View File

@@ -4,8 +4,7 @@ from http.client import HTTPConnection as _HTTPConnection, HTTPException as HTTP
from typing import Any
from . import exceptions, util
from .packages import ssl_match_hostname
from .util import ssl_
from .util import ssl_, ssl_match_hostname
class DummyConnection: ...

View File

@@ -7,8 +7,7 @@ from typing_extensions import Literal, Self, TypeAlias
from . import connection, exceptions, request, response
from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException
from .packages import ssl_match_hostname
from .util import Url, connection as _connection, queue as urllib3queue, retry, timeout, url
from .util import Url, connection as _connection, queue as urllib3queue, retry, ssl_match_hostname, timeout, url
ClosedPoolError = exceptions.ClosedPoolError
ProtocolError = exceptions.ProtocolError

View File

@@ -1,4 +0,0 @@
import ssl
CertificateError = ssl.CertificateError
match_hostname = ssl.match_hostname

View File

@@ -1,3 +0,0 @@
class CertificateError(ValueError): ...
def match_hostname(cert, hostname): ...

View File

@@ -0,0 +1,8 @@
from ssl import _PeerCertRetDictType
from typing_extensions import Final
__version__: Final[str]
class CertificateError(ValueError): ...
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...