[PATCH] http2: make it possible to connect w/o ssl on port 443

Augie Fackler raf at durin42.com
Wed Oct 17 10:02:44 CDT 2012


See any reason I shouldn't just push the patch? Look reasonable?

On Wed, Oct 17, 2012 at 10:01 AM, David M. Carr <david at carrclan.us> wrote:
> On Wed, Oct 17, 2012 at 10:13 AM, Augie Fackler <raf at durin42.com> wrote:
>> On Wed, Oct 17, 2012 at 8:27 AM, David M. Carr <david at carrclan.us> wrote:
>>> On Wed, Oct 17, 2012 at 9:12 AM, Augie Fackler <raf at durin42.com> wrote:
>>>> # HG changeset patch
>>>> # User Augie Fackler <raf at durin42.com>
>>>> # Date 1350428733 18000
>>>> # Node ID 21503aa02d4fa98926884e2e5cda9131bcd16797
>>>> # Parent  72c234081ae1350220132c69750f5a093902a1e7
>>>> http2: make it possible to connect w/o ssl on port 443
>>>>
>>>> The fix is just to make sure we always pass use_ssl=False to non-SSL
>>>> connections.
>>>>
>>>> diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py
>>>> --- a/mercurial/httpconnection.py
>>>> +++ b/mercurial/httpconnection.py
>>>> @@ -233,7 +233,9 @@
>>>>      def http_open(self, req):
>>>>          if req.get_full_url().startswith('https'):
>>>>              return self.https_open(req)
>>>> -        return self.do_open(HTTPConnection, req, False)
>>>> +        def makehttpcon(*args, **kwargs):
>>>> +            return HTTPConnection(*args, use_ssl=False, **kwargs)
>>>> +        return self.do_open(makehttpcon, req, False)
>>>>
>>>>      def https_open(self, req):
>>>>          # req.get_full_url() does not contain credentials and we may
>>>> _______________________________________________
>>>> Mercurial-devel mailing list
>>>> Mercurial-devel at selenic.com
>>>> http://selenic.com/mailman/listinfo/mercurial-devel
>>>
>>> I assume there wasn't any pre-existing test coverage for this case
>>> that needs updating.  Do you think it's worth adding test coverage for
>>> this?
>>
>> Maybe - writing a test for this isn't trivial since you have to
>> connect to a server on a specific port, rather than a random one. I
>> didn't want to block the fix (which was irritating a fog creeker
>> yesterday) on trying to contrive a fix.
>>
>>>
>>> --
>>> David M. Carr
>>> david at carrclan.us
>
> Makes sense to me.
>
> --
> David M. Carr
> david at carrclan.us


More information about the Mercurial-devel mailing list