예제 #1
0
 def make_connection(self, host):
   try:
     if self._scheme == 'http':
       return Transport.make_connection(self, host)
     return SafeTransport.make_connection(self, host)
   except socket.error, e:
     raise ProtocolError(host, -1, "Could not connect to server", None)
예제 #2
0
    def make_connection(self, host):
        self.host = host
        if self.proxy:
            host = self.proxy.split('://', 1)[-1]
        if self.https:
            c = SafeTransport.make_connection(self, host)
        else:
            c = Transport.make_connection(self, host)

        c.timeout = self.timeout

        return c
예제 #3
0
 def make_connection(self, host):
     """Create the connection for the transport and save it."""
     self.conn = SafeTransport.make_connection(self, host)
     return self.conn
예제 #4
0
    def make_connection(self, host):
        c = SafeTransport.make_connection(self, host)
        c.timeout = self.timeout

        return c
예제 #5
0
 def make_connection(self, host):
     """Create the connection for the transport and save it."""
     self.conn = SafeTransport.make_connection(self, host)
     return self.conn
예제 #6
0
 def make_connection(self,host):
     host_with_cert = (host, {
         'key_file'  :  self.__key_file,
         'cert_file' :  self.__cert_file
         })
     return SafeTransport.make_connection(self,host_with_cert)