From a132da3976a2449f50c2e3d97e64573ed581feb8 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 20 Aug 2021 23:26:55 -0400 Subject: [PATCH 1/2] src/untangle/untangle.py: use cleaner way of disabling verification. In the past, the internal _create_unverified_context() method of the ssl module was used to create a context that doesn't verify certificates. However, (now?) there is a cleaner way: by setting the context's "check_hostname" member to False and its "verify_mode" member to ssl.CERT_NONE. Which is exactly what this commit does. --- src/untangle/untangle.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/untangle/untangle.py b/src/untangle/untangle.py index 570e896..8ce4fb7 100644 --- a/src/untangle/untangle.py +++ b/src/untangle/untangle.py @@ -68,10 +68,10 @@ class Untangle: # SSL mumbo jumbo to make it ignore the certificate's hostname # when verify_cert = False. - if self.verify_cert: - ssl_ctx = ssl.create_default_context() - else: - ssl_ctx = ssl._create_unverified_context() + ssl_ctx = ssl.create_default_context() + if not self.verify_cert: + ssl_ctx.check_hostname = False + ssl_ctx.verify_mode = ssl.CERT_NONE https_handler = urllib.request.HTTPSHandler(context=ssl_ctx) -- 2.43.2 From 175c6e10ecfa10abe772e4c642f578639dd86b83 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 6 May 2024 14:56:07 -0400 Subject: [PATCH 2/2] doc/COPYING: add one to state the "or later" bit --- doc/COPYING | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/COPYING diff --git a/doc/COPYING b/doc/COPYING new file mode 100644 index 0000000..2d86c7c --- /dev/null +++ b/doc/COPYING @@ -0,0 +1,15 @@ +untangle-https-backup: make untangle backups using the web UI +Copyright (C) 2024 Michael Orlitzky + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . -- 2.43.2