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

Re: [PATCH v2] http: add support for different sslcert and sslkey types.

From
SMStanislav M <stanislav.malishevskiy@gmail.com>
Date
Mar 20, 2023, 18:21 UTC
Message-ID
<CAEpdKf=THU=sc3S3W4azBmYp7+J945GxFqhh_i-5kV0kunMdNw@mail.gmail.com>
In-Reply-To
<20230320171051.GA2615782@coredump.intra.peff.net>
Show 14 quoted lines
> > @@ -1014,10 +1020,14 @@ static CURL *get_curl_handle(void)
> >
> >       if (ssl_cert)
> >               curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
> > +     if (ssl_cert_type)
> > +             curl_easy_setopt(result, CURLOPT_SSLCERTTYPE, ssl_cert_type);
>
> We're just feeding curl whatever string the user gave us (which is good,
> since we don't know which ones are valid). But what happens with:
>
>   GIT_SSL_CERT_TYPE=bogus git fetch ...
>
> Should we check for an error here, or will the actual request later
> complain properly?

Curl itself validates that string. And if we pass the wrong type or not pass 'ENG' in case of pkcs11: curl will return an error. In that case git do the same if GIT_SSL_CERT passed wrong ss 'ENG' in case of pkcs11: curl will return an error. In that case git do the same if GIT_SSL_CERT passed wrong

пн, 20 мар. 2023 г. в 20:10, Jeff King <peff@peff.net>:
Show 42 quoted lines
>
> On Mon, Mar 20, 2023 at 03:48:49PM +0000, Stanislav Malishevskiy via GitGitGadget wrote:
>
> > From: Stanislav Malishevskiy <s.malishevskiy@auriga.com>
> >
> > Basically git work with default curl ssl type - PEM. But for support
> > eTokens like SafeNet tokens via pksc11 need setup 'ENG' as sslcert type
> > and as sslkey type. So there added additional options for http to make
> > that possible.
>
> Seems like a reasonable thing to want, and the patch looks pretty clean.
> Two small points:
>
> >  http.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
>
> There are no tests here. I think it might be possible to add them, but
> our https test support is currently optional, and has bit-rotted a bit
> over the years. There's some discussion here:
>
>   https://lore.kernel.org/git/Y9s7vyHKXP+TQPRm@pobox.com/
>
> So I don't think it makes sense to block this patch over the lack of
> tests, but it's something we might keep in mind to add if the test
> situation improves.
>
> > @@ -1014,10 +1020,14 @@ static CURL *get_curl_handle(void)
> >
> >       if (ssl_cert)
> >               curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
> > +     if (ssl_cert_type)
> > +             curl_easy_setopt(result, CURLOPT_SSLCERTTYPE, ssl_cert_type);
>
> We're just feeding curl whatever string the user gave us (which is good,
> since we don't know which ones are valid). But what happens with:
>
>   GIT_SSL_CERT_TYPE=bogus git fetch ...
>
> Should we check for an error here, or will the actual request later
> complain properly?
>
> -Peff
Previous: Jeff KingNext: Jeff King
Message 4 of 16 in “That change for support different sslcert and sslkey types.”
  1. That change for support different sslcert and sslkey types.Stanislav Malishevskiy via GitGitGadget, Mar 19, 2023
  2. http: add support for different sslcert and sslkey types.Stanislav Malishevskiy via GitGitGadget, Mar 20, 2023
  3. Jeff KingMar 20, 2023
  4. Stanislav MMar 20, 2023
  5. Jeff KingMar 21, 2023
  6. Junio C HamanoMar 20, 2023
  7. Stanislav MMar 20, 2023
  8. Jeff KingMar 21, 2023
  9. Junio C HamanoMar 21, 2023
  10. Stanislav MMar 23, 2023
  11. Jeff KingMar 23, 2023
  12. Stanislav MMar 23, 2023
  13. Junio C HamanoMar 29, 2023
  14. Stanislav MMar 29, 2023
  15. Jeff KingMar 29, 2023
  16. Junio C HamanoMar 30, 2023

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.