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

Re: Multiple GIT Accounts & HTTPS Client Certificates - Config

From
Sergei Haller <sergei@sergei-haller.de>
Date
Sep 11, 2018, 07:29 UTC
Message-ID
<CAPO0KtW8HGjdRcb7cStBqK1LA4f7jjxgXaDKOLhXpYAE_o+08w@mail.gmail.com>
In-Reply-To
<001901d4490a$528d7590$f7a860b0$@nexbridge.com>

no, using SSH is not an option. I have no control over the server setup whatsoever.

Thx!

On Mon, Sep 10, 2018 at 3:29 PM, Randall S. Becker <rsbecker@nexbridge.com> wrote:

Show 56 quoted lines
> On September 10, 2018 4:09 AM, Sergei Haller wrote:
>> my problem is basically the following: my git server (https) requires
>> authentication using a clent x509 certificate.
>>
>> And I have multiple x509 certificates that match the server.
>>
>> when I access the https server using a browser, the browser asks which
>> certificate to use and everything is fine.
>>
>> When I try to access the git server from the command line (git pull or similar),
>> the git will pick one of the available certificates (randomly or alphabetically)
>> and try to access the server with that client certificate. Ending in the
>> situation that git picks the wrong certificate.
>>
>> I can workaround by deleting all client certificates from the windows
>> certificate store except the "correct" one => then git command line will pick
>> the correct certificate (the only one available) and everything works as
>> expected.
>>
>> Workaround is a workaround, I need to use all of the certificates repeatedly
>> for different repos and different other aplications (non-git), so I've been
>> deliting and reinstalling the certificates all the time in the last weeks...
>>
>> How can I tell git cmd (per config option??) to use a particular client
>> certificate for authenticating to the https server (I could provide fingerprint
>> or serial number or sth like that)
>>
>> current environment: windows 10 and git version 2.18.0.windows.1
>>
>> Would be absolutely acceptable if git would ask interactively which client
>> certificate to use (in case its not configurable)
>>
>> (I asked this question here before:
>> https://stackoverflow.com/questions/51952568/multiple-git-accounts-
>> https-client-certificates-config
>> )
>
> Would you consider using SSH to authenticate? You can control which private key you use based on your ~/.ssh/config entries, which are case sensitive. You can choose the SSH key to use by playing with the case of the host name, like:
>
> github.com
> Github.com
> gitHub.com
>
> even if your user is "git" in all cases above. It is a bit hacky but it is part of the SSH spec and is supported by git and EGit (as of 5.x).
>
> Cheers,
> Randall
>
> --
> Randall S. Becker
> Managing Director, Nexbridge Inc.
> LinkedIn.com/in/randallbecker
> +1.416.984.9826
>
>
>
-- 
sergei@sergei-haller.de
.
Previous: Randall S. BeckerNext: Sergei Haller
Message 3 of 5 in “Multiple GIT Accounts & HTTPS Client Certificates - Config”
  1. Sergei HallerSep 10, 2018
  2. Randall S. BeckerSep 10, 2018
  3. Sergei HallerSep 11, 2018
  4. Sergei HallerSep 11, 2018
  5. brian m. carlsonSep 13, 2018

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.