From 56b170b04c6d939295d5bb0fb1ef367c952a5f00 Mon Sep 17 00:00:00 2001 From: theSheriff Date: Tue, 7 Apr 2020 16:18:13 -0400 Subject: [PATCH] Added ssl_ignore attribute to platform Added ssl_ignore attribute to platform to allow users to ignore self-signed or other SSL errors. Defaults to SSL verification ON --- dashmachine/platform/http_status.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dashmachine/platform/http_status.py b/dashmachine/platform/http_status.py index 21b9efc..67911ed 100644 --- a/dashmachine/platform/http_status.py +++ b/dashmachine/platform/http_status.py @@ -63,7 +63,9 @@ class Platform: self.headers = None if not hasattr(self, "return_codes"): self.return_codes = "2xx,3xx" - + if not hasattr(self, "ssl_ignore"): + self.ssl_ignore = "No" + def process(self): # Check if method is within allowed methods for http_status if self.method.upper() not in ["GET", "HEAD", "OPTIONS", "TRACE"]: @@ -84,6 +86,10 @@ class Platform: self.method.upper(), self.resource, headers=self.headers, auth=auth ) prepped = req.prepare() + if self.ssl_ignore == "yes": + resp = s.send(prepped,verify=False) + else: + resp = s.send(prepped) resp = s.send(prepped) return_codes = tuple([x.replace("x", "") for x in self.return_codes.split(",")])