I have a gitlab installation on a server in the local network listening on some port p using a self signed SSL certificate for its IP (192.168.x.y).
When cloning a repository from the server I was okay with temporarily ignoring a SSL verification:
git -c http.sslVerify=false clone https://192.168.x.y:p/path/to/repo.git
Now, when working with the origin (e.g. git pull origin
) I don't want to ignore the SSL verification because of possible MitM attacks. That's why I included the cert in the local git config:
git config http.sslCAInfo /etc/gitlab/ssal/192.168.x.y.crt
git pull origin
now doesn't complain anymore that the certificate cannot be verified but instead issues that the subject name wouldn't match the host name:
fatal: unable to access 'https://192.168.x.y:p/path/to/repo.git/': SSL: certificate subject name (192.168.x.y) does not match target host name '192.168.x.y'
However I checked multiple times, that they perfectly match. Is it not possible to use self signed certificates for local IPs in git?