]> gitweb.michael.orlitzky.com - untangle-https-backup.git/commitdiff
doc/COPYING: add one to state the "or later" bit master
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 6 May 2024 18:56:07 +0000 (14:56 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 6 May 2024 18:56:07 +0000 (14:56 -0400)
doc/COPYING [new file with mode: 0644]
src/untangle/untangle.py

diff --git a/doc/COPYING b/doc/COPYING
new file mode 100644 (file)
index 0000000..2d86c7c
--- /dev/null
@@ -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 <https://www.gnu.org/licenses/>.
index 570e89667ce329b0fd0b3c82a465ef7672ca702c..8ce4fb7f39b3017c49cfdd0295787ac047319862 100644 (file)
@@ -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)