0

I have a server that has DNS problems and cannot find "Github.com". I have to use Github's IP address instead. But when I try to use the IP address like this:

git remote set-url origin http://192.30.253.113/foo/bar.git 

when I try to push to origin this happens:

git push origin master 

fatal: unable to access 'https://192.30.253.113/foo/bar.git/': SSL: certificate subject name (github.com) does not match target host name '192.30.253.113'

1

1 Answer 1

4

Git pull does not work, because Git verifies the SSL certificate and checks whether the hostname matches the name in the certificate. In your case the IP is not included in the certificate and, thus, you are getting this error.

An option could be to disable SSL (as described in https://stackoverflow.com/a/16869961/3906760), however, that would allow attackers to MitM your connection.

Instead of disabling SSL verification, why don't you add github.com to /etc/hosts (cf. https://ubuntuforums.org/showthread.php?t=3407), then SSL certificate validation would still work.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks. that worked. I added github.com to /etc/hosts

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.