diff --git a/vmware_nsxlib/v3/cluster.py b/vmware_nsxlib/v3/cluster.py index 13339838..63ddfa3a 100644 --- a/vmware_nsxlib/v3/cluster.py +++ b/vmware_nsxlib/v3/cluster.py @@ -243,6 +243,12 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider): # Add allow-overwrite if configured if allow_overwrite_header: session.default_headers['X-Allow-Overwrite'] = 'true' + + if session.cert_provider: + # Session create will fail with cert provider + LOG.debug("Skipping session create with client certificate auth") + return + # Perform the initial session create and get the relevant jsessionid & # X-XSRF-TOKEN for future requests req_data = '' @@ -260,7 +266,7 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider): LOG.error("Session create failed for endpoint %s due to " "error in retrieving JSON Web Token: %s", provider.url, e) - elif not session.cert_provider: + else: # With client certificate authentication, username and password # may not be provided. # If provided, backend treats these credentials as authentication