Skip to content

Commit 95f0cab

Browse files
committed
SPL-264208 MSB-3468 Update python library to support mTLS when web private key is encrypted
1 parent 4415aed commit 95f0cab

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

solnlib/server_info.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ def getWebKeyFile():
3131
return None
3232

3333

34+
try:
35+
from splunk.rest import is_cert_or_key_encrypted
36+
except (ModuleNotFoundError, ImportError):
37+
38+
def is_cert_or_key_encrypted():
39+
return False
40+
41+
3442
from splunklib import binding
3543
from solnlib import splunk_rest_client as rest_client
3644
from solnlib import utils
@@ -75,7 +83,7 @@ def __init__(
7583
host == "localhost" or host == "127.0.0.1" or host in ("::1", "[::1]")
7684
)
7785

78-
if getWebCertFile() and getWebKeyFile():
86+
if getWebCertFile() and getWebKeyFile() and not is_cert_or_key_encrypted():
7987
context["cert_file"] = getWebCertFile()
8088
context["key_file"] = getWebKeyFile()
8189

0 commit comments

Comments
 (0)