git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv4] http: add support for specifying the SSL version

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 14, 2015, 17:57 UTC
Message-ID
<CAPig+cSUR4CEbg3HobZPHyWfGFoGzctP7BbTswg8vyXjGmma6Q@mail.gmail.com>
In-Reply-To
<1439570135-17324-1-git-send-email-gitter.spiros@gmail.com>
On Fri, Aug 14, 2015 at 12:35 PM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 11 quoted lines
> Teach git about a new option, "http.sslVersion", which permits one to
> specify the SSL version  to use when negotiating SSL connections.  The
> setting can be overridden by the GIT_SSL_VERSION environment
> variable.
>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> ---
> This is the fourth revision of the patch. Changes from previous
>
> - Used only ARRAY_SIZE for walking sslversions (Eric, Junio)
> - Fixed some problems of style: spurious blanks in if stm, wrapped warning

Thanks, this is looking better. A few very minor style-related comments below (most or all of which were mentioned previously, I think)...

Show 11 quoted lines
> diff --git a/http.c b/http.c
> index e9c6fdd..83118b5 100644
> --- a/http.c
> +++ b/http.c
> @@ -364,9 +380,22 @@ static CURL *get_curl_handle(void)
>         if (http_proactive_auth)
>                 init_curl_http_auth(result);
>
> +       if (getenv("GIT_SSL_VERSION"))
> +               ssl_version = getenv("GIT_SSL_VERSION");
> +       if (ssl_version != NULL && *ssl_version) {
In this codebase, it is customary to omit the "!= NULL", so:
    if (ssl_version && *ssl_version) {
> +               int i;
> +               for ( i = 0; i < ARRAY_SIZE(sslversions); i++ ) {
Style: Drop space after open '(' and before close ')' in 'for' loop:
    for (i = 0; i < ARRAY_SIZE(sslversions); i++) {
> +                       if (!strcmp(ssl_version,sslversions[i].name)) {
Style: Insert space after comma.
Show 6 quoted lines
> +                               curl_easy_setopt(result, CURLOPT_SSLVERSION,
> +                                       sslversions[i].ssl_version);
> +                               break;
> +                       }
> +               }
> +               if (i == ARRAY_SIZE(sslversions)) warning("unsupported ssl version %s: using default",ssl_version);
warning() call should be on its own line.
Style: Insert space after comma.
Show 10 quoted lines
> +       }
> +
>         if (getenv("GIT_SSL_CIPHER_LIST"))
>                 ssl_cipherlist = getenv("GIT_SSL_CIPHER_LIST");
> -
>         if (ssl_cipherlist != NULL && *ssl_cipherlist)
>                 curl_easy_setopt(result, CURLOPT_SSL_CIPHER_LIST,
>                                 ssl_cipherlist);
> --
> 2.5.0.235.gb9bd8dc
Previous: Elia Pinto
Message 2 of 2 in “[PATCHv4] http: add support for specifying the SSL version”
  1. Elia PintoAug 14, 2015
  2. Eric SunshineAug 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.