]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1663] Ready for review
authorFrancis Dupont <fdupont@isc.org>
Thu, 25 Mar 2021 08:43:24 +0000 (09:43 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 25 Mar 2021 08:43:24 +0000 (09:43 +0100)
src/bin/shell/kea_connector2.py
src/bin/shell/kea_connector3.py

index e4c90004f973dedbb21bd5972a23798761f1547b..fcd9d9bb1b95f59e4f4a5c18e53bf4b0b3b882e5 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -16,8 +16,8 @@ def send_to_control_agent(params):
     """ 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)
index 526827f5eb034a3d7503047f608a2473ef720d44..4acad3bd94b618e4ddcd9ef76fce41011afe2cdd 100644 (file)
@@ -31,11 +31,11 @@ def send_to_control_agent(params):
     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])