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.
This commit is contained in:
		
							parent
							
								
									ea139d2ec7
								
							
						
					
					
						commit
						991e645fdb
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -86,6 +86,9 @@ class Client(object):
 | 
				
			||||||
    # request timeout in seconds
 | 
					    # request timeout in seconds
 | 
				
			||||||
    timeout = 30
 | 
					    timeout = 30
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # controls whether to verify the server's TLS certificate or not
 | 
				
			||||||
 | 
					    verify = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # HTTP headers for different actions
 | 
					    # HTTP headers for different actions
 | 
				
			||||||
    http_header = {
 | 
					    http_header = {
 | 
				
			||||||
        'list': ["Accept: */*", "Depth: 1"],
 | 
					        'list': ["Accept: */*", "Depth: 1"],
 | 
				
			||||||
| 
						 | 
					@ -159,7 +162,8 @@ class Client(object):
 | 
				
			||||||
            headers=self.get_headers(action, headers_ext),
 | 
					            headers=self.get_headers(action, headers_ext),
 | 
				
			||||||
            timeout=self.timeout,
 | 
					            timeout=self.timeout,
 | 
				
			||||||
            data=data,
 | 
					            data=data,
 | 
				
			||||||
            stream=True
 | 
					            stream=True,
 | 
				
			||||||
 | 
					            verify=self.verify
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        if response.status_code == 507:
 | 
					        if response.status_code == 507:
 | 
				
			||||||
            raise NotEnoughSpace()
 | 
					            raise NotEnoughSpace()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue