mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
simplify code (#9807)
This commit is contained in:
parent
5cf5f36f19
commit
6f7b5ab1cd
2 changed files with 5 additions and 10 deletions
|
|
@ -47,15 +47,8 @@ ECDSA_KEY_TYPE = 'ecdsa'
|
|||
|
||||
|
||||
def _suppress_x509_verification_warnings() -> None:
|
||||
try:
|
||||
import urllib3
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
except ImportError:
|
||||
# Handle old versions of request with vendorized urllib3
|
||||
# pylint: disable=no-member,line-too-long
|
||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning # type: ignore[import-untyped]
|
||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # type: ignore[attr-defined]
|
||||
# pylint: enable=no-member,line-too-long
|
||||
import urllib3
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
def check_until_timeout(url: str, attempts: int = 30) -> None:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ install_requires = [
|
|||
'pywin32>=300 ; sys_platform == "win32"',
|
||||
'pyyaml',
|
||||
'pytz>=2019.3',
|
||||
'requests',
|
||||
# requests unvendored its dependencies in version 2.16.0 and this code relies on that for
|
||||
# calling `urllib3.disable_warnings`.
|
||||
'requests>=2.16.0',
|
||||
'setuptools',
|
||||
'types-python-dateutil',
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue