diff --git a/muranoclient/common/http.py b/muranoclient/common/http.py index 5b275f8e..30a5116c 100644 --- a/muranoclient/common/http.py +++ b/muranoclient/common/http.py @@ -327,10 +327,17 @@ class VerifiedHTTPSConnection(HTTPSConnection): connecting to, ie that the certificate's Common Name or a Subject Alternative Name matches 'host'. """ + common_name = x509.get_subject().commonName + # First see if we can match the CN - if x509.get_subject().commonName == host: + if common_name == host: return True + # Support single wildcard matching + if common_name.startswith('*.') and host.find('.') > 0: + if common_name[2:] == host.split('.', 1)[1]: + return True + # Also try Subject Alternative Names for a match san_list = None for i in xrange(x509.get_extension_count()): diff --git a/setup.cfg b/setup.cfg index e2b0b6d0..e437abbb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = python-muranoclient -version = 0.2 +version = 0.3 summary = python-muranoclient description-file = README.rst