diff --git a/proxmoxer/backends/https.py b/proxmoxer/backends/https.py index 2bb054d..6d238f5 100644 --- a/proxmoxer/backends/https.py +++ b/proxmoxer/backends/https.py @@ -287,7 +287,14 @@ def __init__( if "token" not in SERVICES[service]["supported_https_auths"]: config_failure("{} does not support API Token authentication", service) - self.auth = ProxmoxHTTPApiTokenAuth(user, token_name, token_value, service=service) + self.auth = ProxmoxHTTPApiTokenAuth( + user, + token_name, + token_value, + verify_ssl=verify_ssl, + timeout=timeout, + service=service, + ) elif password is not None: if "password" not in SERVICES[service]["supported_https_auths"]: config_failure("{} does not support password authentication", service) diff --git a/tests/test_https.py b/tests/test_https.py index 97e2f61..69d7d08 100644 --- a/tests/test_https.py +++ b/tests/test_https.py @@ -108,6 +108,22 @@ def test_get_tokens_password(self, mock_pve): assert ("ticket", "CSRFPreventionToken") == backend.get_tokens() + def test_verify_ssl_token(self): + backend = https.Backend("1.2.3.4:1234", token_name="name") + assert backend.auth.verify_ssl is True + + def test_verify_ssl_false_token(self): + backend = https.Backend("1.2.3.4:1234", token_name="name", verify_ssl=False) + assert backend.auth.verify_ssl is False + + def test_verify_ssl_password(self, mock_pve): + backend = https.Backend("1.2.3.4:1234", password="name") + assert backend.auth.verify_ssl is True + + def test_verify_ssl_false_password(self, mock_pve): + backend = https.Backend("1.2.3.4:1234", password="name", verify_ssl=False) + assert backend.auth.verify_ssl is False + class TestProxmoxHTTPAuthBase: """