From 4cdf5137c82d0ba555665665c8bbe56ef8fd168c Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Wed, 1 Mar 2017 15:17:49 -0500 Subject: [PATCH] bugfix: avoid calling SSL get_default_verify_paths if not available --- pyngus/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyngus/connection.py b/pyngus/connection.py index 2113c2c..41b4610 100644 --- a/pyngus/connection.py +++ b/pyngus/connection.py @@ -745,7 +745,8 @@ class Connection(Endpoint): identity = properties.get('x-ssl-identity') ca_file = properties.get('x-ssl-ca-file') - if properties.get('x-ssl') and not ca_file: + if (not ca_file and properties.get('x-ssl') and + hasattr(ssl, 'get_default_verify_paths')): ca_file = ssl.get_default_verify_paths().cafile hostname = properties.get('x-ssl-peer-name', properties.get('hostname'))