git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* passing CURLOPT_CERTTYPE to libcurl
@ 2021-12-18  0:06 Florian Mickler
  2021-12-18  1:08 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Mickler @ 2021-12-18  0:06 UTC (permalink / raw)
  To: git; +Cc: jqassar

Hi,

I recently needed to use a tls client certificate from my companies pki
card (smartcard)  in order to get access to a git repository via https.
The client system I used was set up such that there was a pkcs11 openssl
module that would asks for a pin whenever the certificate was needed. 

While I was able to connect to the git repo via curl with 

	curl -E 'pkcs\:[REDACTED_PART_OF_PKCS_URL]' --key\
	'pkcs:[REDACTED_PART_OF_PKCS_URL]' --cert-type ENG\
	--key-type ENG $URL

I was not able to connect to the host with current git. I could pass
the pkcs urls for key and cert, but openssl expected them to be in "PEM"
encoding. While the certificates on the card where apparently of form
"ENG". 

After a bit of searching, I found a patch[1] for git to pass
the cert-type to libcurl (CURLOPT_SSLKEYTYPE and CURLOPT_SSLCERTTYPE)
from 2013. And sure enough, forward-porting it to current HEAD meant
that I could successfully connect to that host and clone the repo. 

Only the CURLOPT_SSLKEYTYPE and CURLOPT_SSLCERTTYPE are needed in my
case, because the openssl config sets up the pkcs11 module. My
understanding is that the pkcs11 module get's triggered by the
pkcs11:urls for key and cert. It might be this openssl module: 
https://github.com/OpenSC/libp11 

Is there a specific reason, that patch wasn't merged? It would allow
for non-pem ssl certificates to be loaded also (without pkcs11 at all). 

I realize, that the underlying systems could and should set up
everything automagically as soon as i point them to the certificate that
i want to use. But not opening up these CURL Settings from git seems
kind of silly given that today's systems still seem kinda borked and do
not do that.  What harm comes from these two tuning knobs being exposed?

Best regards,
Flo


[1] https://marc.info/?l=git&m=136675822032549&w=2



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-21 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-18  0:06 passing CURLOPT_CERTTYPE to libcurl Florian Mickler
2021-12-18  1:08 ` Junio C Hamano
2021-12-20 22:21   ` Johannes Schindelin
2021-12-21  9:45     ` Florian Mickler
2021-12-21 16:20       ` Ævar Arnfjörð Bjarmason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).