From 991e645fdb15082d7556c8b47c755b81b5b5ed62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20H=C3=A5kansson?= Date: Tue, 18 Jun 2019 09:21:31 +0200 Subject: [PATCH] Added verify attribute to execute_request method To be able to control whether to verify the server's TLS certificate or not, the verify attribute has been added to the execute_request method. --- webdav3/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webdav3/client.py b/webdav3/client.py index 92bb4ee..82b26d6 100644 --- a/webdav3/client.py +++ b/webdav3/client.py @@ -86,6 +86,9 @@ class Client(object): # request timeout in seconds timeout = 30 + # controls whether to verify the server's TLS certificate or not + verify = True + # HTTP headers for different actions http_header = { 'list': ["Accept: */*", "Depth: 1"], @@ -159,7 +162,8 @@ class Client(object): headers=self.get_headers(action, headers_ext), timeout=self.timeout, data=data, - stream=True + stream=True, + verify=self.verify ) if response.status_code == 507: raise NotEnoughSpace()