mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
snap_config: switch to newer HttpAdapter interface
This commit is contained in:
parent
c31f53a225
commit
35091d878f
1 changed files with 8 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ from typing import Iterable
|
|||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
from requests import Session
|
||||
from requests import PreparedRequest, Session
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.exceptions import HTTPError
|
||||
from requests.exceptions import RequestException
|
||||
|
|
@ -100,6 +100,11 @@ class _SnapdConnectionPool(HTTPConnectionPool):
|
|||
|
||||
|
||||
class _SnapdAdapter(HTTPAdapter):
|
||||
def get_connection(self, url: str,
|
||||
proxies: Optional[Iterable[str]] = None) -> _SnapdConnectionPool:
|
||||
def get_connection_with_tls_context(self, _request: PreparedRequest,
|
||||
_verify: bool,
|
||||
_proxies: Optional[Iterable[str]] = None,
|
||||
_cert: Optional[bytes] = None
|
||||
) -> _SnapdConnectionPool:
|
||||
"""Required method for creating a new connection pool. Simply return our
|
||||
shim that forces a UNIX socket connection to snapd."""
|
||||
return _SnapdConnectionPool()
|
||||
|
|
|
|||
Loading…
Reference in a new issue