mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
urllib3: move stubs for ssl_match_hostname around (#10117)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import ssl
|
||||
|
||||
CertificateError = ssl.CertificateError
|
||||
match_hostname = ssl.match_hostname
|
||||
@@ -1,3 +0,0 @@
|
||||
class CertificateError(ValueError): ...
|
||||
|
||||
def match_hostname(cert, hostname): ...
|
||||
8
stubs/urllib3/urllib3/util/ssl_match_hostname.pyi
Normal file
8
stubs/urllib3/urllib3/util/ssl_match_hostname.pyi
Normal 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: ...
|
||||
Reference in New Issue
Block a user