diff cagou/core/cagou_main.py @ 280:b0461363bc65

core: certificate validation can be disabled: By using "no_certificate_validation=true" in sat.conf in [cagou] section, certificate validation can be disabled. This is mainly useful for developping on local machines with self-signed certificates.
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:29:44 +0100
parents a0835f0212d8
children ef77423ce500
line wrap: on
line diff
--- a/cagou/core/cagou_main.py	Wed Mar 20 09:29:44 2019 +0100
+++ b/cagou/core/cagou_main.py	Wed Mar 20 09:29:44 2019 +0100
@@ -429,6 +429,14 @@
         self._visible_widgets = {}  # visible widgets by classes
         self.version = C.APP_VERSION  # will be replaced by getVersion()
 
+        if C.bool(config.getConfig(main_config,
+                                   C.CONFIG_SECTION,
+                                   'no_certificate_validation',
+                                   C.BOOL_FALSE)):
+            from cagou.core import patches
+            patches.apply()
+            log.warning(u"SSL certificate validation is disabled, this is unsecure!")
+
     @property
     def visible_widgets(self):
         for w_list in self._visible_widgets.itervalues():