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

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

From
Remi Galan Alfonso <remi.galan-alfonso@ensimag.grenoble-inp.fr>
Date
Aug 12, 2015, 13:33 UTC
Message-ID
<950187984.739852.1439386399510.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<1439384456-16335-1-git-send-email-gitter.spiros@gmail.com>
Hello, Elia
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 20 quoted lines
> +        if (ssl_version != NULL && *ssl_version) {
> +                if (!strcmp(ssl_version,"tlsv1")) {
> +                        sslversion = CURL_SSLVERSION_TLSv1;
> +                } else if (!strcmp(ssl_version,"sslv2")) {
> +                        sslversion = CURL_SSLVERSION_SSLv2;
> +                } else if (!strcmp(ssl_version,"sslv3")) {
> +                        sslversion = CURL_SSLVERSION_SSLv3;
> +#if LIBCURL_VERSION_NUM >= 0x072200
> +                } else if (!strcmp(ssl_version,"tlsv1.0")) {
> +                        sslversion = CURL_SSLVERSION_TLSv1_0;
> +                } else if (!strcmp(ssl_version,"tlsv1.1")) {
> +                        sslversion = CURL_SSLVERSION_TLSv1_1;
> +                } else if (!strcmp(ssl_version,"tlsv1.2")) {
> +                        sslversion = CURL_SSLVERSION_TLSv1_2;
> +                } else {
> +                        warning("unsupported ssl version %s : using default",
> +                        ssl_version);
> +#endif
> +                }
> +        }

I'm curious about what would happen should 'sslVersion' be set to 'tlsv1.0' (or a value that doesn't belong to the possible values) and 'LIBCURL_VERSION_NUM' be inferior to '0x072200'. Since we wouldn't go through any 'if' and would also skip the 'else' case, wouldn't we have a silent 'unsupported ssl version: using default' ?

So I think that the 'else' case should be outside of the '#if [...] #endif'.

Thanks, Rémi

Previous: Elia PintoNext: Elia Pinto
Message 2 of 3 in “http: add support for specifying the SSL version”
  1. http: add support for specifying the SSL versionElia Pinto, Aug 12, 2015
  2. Remi Galan AlfonsoAug 12, 2015
  3. Elia PintoAug 12, 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.