@@ -4505,41 +4505,6 @@ def _send_form(self, url, params):
45054505 raise ShotgunError ("Max attemps limit reached." )
45064506
45074507
4508- class CACertsHTTPSConnection (http .client .HTTPConnection ):
4509- """ "
4510- This class allows to create an HTTPS connection that uses the custom certificates
4511- passed in.
4512- """
4513-
4514- default_port = http .client .HTTPS_PORT
4515-
4516- def __init__ (self , * args , ** kwargs ):
4517- """
4518- :param args: Positional arguments passed down to the base class.
4519- :param ca_certs: Path to the custom CA certs file.
4520- :param kwargs: Keyword arguments passed down to the bas class
4521- """
4522- # Pop that argument,
4523- self .__ca_certs = kwargs .pop ("ca_certs" )
4524- super ().__init__ (self , * args , ** kwargs )
4525-
4526- def connect (self ):
4527- "Connect to a host on a given (SSL) port."
4528- super ().connect (self )
4529- # Now that the regular HTTP socket has been created, wrap it with our SSL certs.
4530- if (sys .version_info .major , sys .version_info .minor ) >= (3 , 8 ):
4531- context = ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
4532- context .verify_mode = ssl .CERT_REQUIRED
4533- context .check_hostname = False
4534- if self .__ca_certs :
4535- context .load_verify_locations (self .__ca_certs )
4536- self .sock = context .wrap_socket (self .sock )
4537- else :
4538- self .sock = ssl .wrap_socket (
4539- self .sock , ca_certs = self .__ca_certs , cert_reqs = ssl .CERT_REQUIRED
4540- )
4541-
4542-
45434508# Helpers from the previous API, left as is.
45444509# Based on http://code.activestate.com/recipes/146306/
45454510class FormPostHandler (urllib .request .BaseHandler ):
0 commit comments