Skip to content

Commit

Permalink
leave validation to the context
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Dec 2, 2024
1 parent 529e123 commit da34f31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions kmip/services/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,8 @@ def interrupt_handler(trigger, frame):
if cafile:
context.load_verify_locations(cafile)
certfile = self.config.settings.get('certificate_path')

if certfile:
keyfile = self.config.settings.get('key_path')
context.load_cert_chain(certfile, keyfile=keyfile)
else:
raise ValueError("certfile must be specified for server-side operations")
keyfile = self.config.settings.get('key_path')
context.load_cert_chain(certfile, keyfile=keyfile)

self._socket = context.wrap_socket(
self._socket,
Expand Down
1 change: 0 additions & 1 deletion kmip/tests/unit/services/server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ def test_start(self,
hostname='127.0.0.1',
port=5696,
auth_suite='Basic',
certificate_path='/etc/pykmip/certs/server.crt',
config_path=None,
policy_path=None,
tls_cipher_suites='TLS_RSA_WITH_AES_128_CBC_SHA'
Expand Down

0 comments on commit da34f31

Please sign in to comment.