-# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2017-2021 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
""" Sends a request to Control Agent, receives a response and returns it."""
# No HTTP support.
- if params.ca or params.cert:
- raise NotImplementedError('Python2 kea-shell does not support HTTPS')
+ if params.scheme == 'https':
+ raise NotImplementedError('python2 kea-shell does not support HTTPS')
# Establish HTTP connection first.
conn = httplib.HTTPConnection(params.http_host, params.http_port)
capath = None
cafile = None
if params.ca:
+ ssl_ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
if os.path.isdir(params.ca):
capath = params.ca
else:
cafile = params.ca
- ssl_ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ssl_ctx.load_verify_locations(cafile, capath)
if params.cert:
ssl_ctx.load_cert_chain(params.cert[0], params.cert[1])