Re: [PATCH/RFC] http_init: only initialize SSL for https

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 14, 2013 at 11:45 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
>
>> Apparently, ftps is also handled by cURL and most likely requires SSL.
>>
>> How about optimizing for the common case and instead of prefixcmp(url,
>> "https:")) ask for !prefixcmp(url, "http:")?
>
> I think that is a very sensible way to go.
>
> As to ALL vs DEFAULT, given that its manual page is riddled with a
> scary warning:
>
>     This function must be called at least once within a program (a
>     program is all the code that shares a memory space) before the
>     program calls any other function in libcurl. The environment it sets
>     up is constant for the life of the program and is the same for every
>     program, so multiple calls have the same effect as one call.  ... In
>     normal operation, you must specify CURL_GLOBAL_ALL. Don't use any
>     other value unless you are familiar with it and mean to control
>     internal operations of libcurl.
>
> I think we should stick to ALL.  So
>
>         flags = CURL_GLOBAL_ALL;
>         if (!prefixcmp(url, "http:"))
>                 flags &= ~CURL_GLOBAL_SSL;
>
> would be the way to go.
>
> But this is assuming that nobody feeds our client a http:// URL to
> the server that redirects us to the https:// version (or we do not
> follow such a redirect).  I offhand do not know if that is a valid
> assumption, though.
>

Thanks, both. Very sensible points. I'll re-roll a new version
tomorrow, but it could indeed be that the redirect-case can make this
a no-go.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]