configure Git to accept a particular self-signed server certificate for a particular https remote

The sysadmin for a project I’m on has decided that SSH is “too much trouble”; instead, he has set up Git to be accessible via an https:// URL (and username/password authentication). The server for this URL presents a self-signed certificate, so he advised everyone to turn off certificate validation. This does not strike me as a good setup, security-wise.

Is it possible to tell Git that for remote X (or better, any remote in any repository that happens to begin with https://$SERVERNAME/) it is to accept a particular certificate, and only that certificate? Basically reduplicate SSH’s server-key behavior.

3 Answers
3

Leave a Comment