Ticket #3278: make_AMP_work_with_proxies.patch

File make_AMP_work_with_proxies.patch, 2.1 KB (added by Stas Shtin, 14 years ago)
  • protocols/amp.py

     
    16161616                  'tls_verifyAuthorities']:
    16171617            ab.pop(k, None)
    16181618        ab._sendTo(proto)
    1619         proto._startTLS(self.certificate, self.verify)
     1619        proto._startTLS(self.certificate, self.verify, 1)
    16201620
    16211621
    16221622
     
    16841684        proto._prepareTLS(self.certificate, self.authorities)
    16851685        # XXX before we get back to user code we are going to start TLS...
    16861686        def actuallystart(response):
    1687             proto._startTLS(self.certificate, self.authorities)
     1687            proto._startTLS(self.certificate, self.authorities, 0)
    16881688            return response
    16891689        d.addCallback(actuallystart)
    16901690        return d
     
    19681968                    (certificate, verifyAuthorities)))
    19691969
    19701970
    1971     def _startTLS(self, certificate, verifyAuthorities):
     1971    def _startTLS(self, certificate, verifyAuthorities, client):
    19721972        """
    19731973        Used by TLSBox to initiate the SSL handshake.
    19741974
     
    19821982        self._justStartedTLS = True
    19831983        if verifyAuthorities is None:
    19841984            verifyAuthorities = ()
    1985         self.transport.startTLS(certificate.options(*verifyAuthorities))
     1985        self.transport.startTLS(certificate.options(*verifyAuthorities), client)
    19861986        # Remember that mutable list that we were just talking about?  Here
    19871987        # it is.  sslverify.py takes care of populating this list as
    19881988        # necessary. --glyph
  • internet/tcp.py

     
    656656        """
    657657        return self.repstr
    658658
    659     def startTLS(self, ctx, server=1):
    660         holder = Connection.startTLS(self, ctx)
    661         if server:
    662             self.socket.set_accept_state()
    663         else:
    664             self.socket.set_connect_state()
    665         return holder
     659    def startTLS(self, ctx, client=0):
     660        return super(Server, self).startTLS(ctx, client)
    666661
    667662    def getHost(self):
    668663        """Returns an IPv4Address.