mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Add workaround for platforms where injecting pyopenssl to urllib3 (#3990)
fails with requests package (Ubuntu Trusty)
This commit is contained in:
committed by
Peter Eckersley
parent
30acc5cf47
commit
379807bf0d
+5
-1
@@ -27,7 +27,11 @@ logger = logging.getLogger(__name__)
|
||||
# for SSL, which does allow these options to be configured.
|
||||
# https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
|
||||
if sys.version_info < (2, 7, 9): # pragma: no cover
|
||||
requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3()
|
||||
try:
|
||||
requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3()
|
||||
except AttributeError:
|
||||
import urllib3.contrib.pyopenssl # pylint: disable=import-error
|
||||
urllib3.contrib.pyopenssl.inject_into_urllib3()
|
||||
|
||||
DER_CONTENT_TYPE = 'application/pkix-cert'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user