Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/acme
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2017-01-10 22:39:40 +0300
committerPeter Eckersley <pde@users.noreply.github.com>2017-01-10 22:39:40 +0300
commit379807bf0d3eea104ab94515ab8a7e87217cbd38 (patch)
tree5479d8751c0142373f48d5a3e893c06d461738d4 /acme
parent30acc5cf474adcfdcc8936d2201441d5354d0e12 (diff)
Add workaround for platforms where injecting pyopenssl to urllib3 (#3990)
fails with requests package (Ubuntu Trusty)
Diffstat (limited to 'acme')
-rw-r--r--acme/acme/client.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/acme/acme/client.py b/acme/acme/client.py
index d041cc7d7..b5db57235 100644
--- a/acme/acme/client.py
+++ b/acme/acme/client.py
@@ -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'