2

I am a new git/github user and have encountered the following

error fatal: unable to access 'https://github.com/myusername/my-repo.git/': SSL certificate problem: self-signed certificate in certificate chain

This has me confused because I have made pushes to my remote GitHub repository before without issue. I confirmed that the origin is correct and got the same error message upon running git push and git push -u origin master. I have seen similar questions which don't quite seem to match my situation as either deal with a situation in which the repo is attempting to be cloned (while I am trying to upload) or have not used 'https' (or some other issue).

There is a post which suggests an answer (How to Fix SSL certificate error when want to push to GitHub using git bash?) but I am really very confused as I have never had to explicitly deal with keys before. And no tutorial I have viewed have mentioned them.

Any thoughts? I am on a Windows 10 system using git bash. I am on the same home network I have used to make successful pushes in the past.

3 Answers 3

3

similar issues happen to me when cloning a repo you can try this

git config --global http.sslVerify false 

https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html

Update: Well if you aren't familiar with openssl then you need to get and use it.

unset ignorance

git config --global --unset http.sslVerify 

If you do have it and already created a Certificate then try verifying it just to see what it says

openssl verify domain.crt 

Renew it if it has expired

openssl x509 -in domain.crt -noout -enddate 

If you don't have one, generate your server credentials first

openssl req \ -newkey rsa:2048 -nodes -keyout domain.key \ -out domain.csr 

Now create it

openssl x509 \ -signkey domain.key \ -in domain.csr \ -req -days 365 -out domain.crt 

put it into pem file

cert.pem 

Now import it

git config http.sslCert ~/path/to/ssl/cert.pem 

Then check it with

git config --global --list 

Sources with a few more minor details

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

2 Comments

Your solution worked but I am concerned about what has actually caused the issue in the first place and what I have done to 'resove it.'
expanded it largely let me know if it looks like i left out some steps
0

Set git to trust your certificate using http.sslCAInfo parameter

Configure your certificate as:

git config --global http.sslCAInfo <path to your .pem file> 

You can check your config by:

git config --list 

1 Comment

@Shadow43375: Try this to update your config . It worked for me
-1

just do some step

git config --global user.email "your email address" git config --global user.name "username"

and firstly make sure that your pc ssh key is added to your git account in setting->ssh key section

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.