Before I start, let me say that I have read all the other posts on similar topics and found no solution.
My remote git repository (Gitea) is hosted on an https enabled VPS and the server is configured with SSL client authentication, so it requires a user to provide an SSL client certificate. The repo can be viewed via a web page after importing the client certificate into the browser.
Using Eclipse, I successfully cloned a project to a local git repository before adding SSL client authentication to the remote server. Then I activated SSL client authentication on the server.
When I commit code changes in Eclipse and then use git push
to the remote origin from the command line, the server authenticates the client successfully and the changes are pushed to the remote repo with no problem.
But when I try to push to the remote from within Eclipse it fails with the error "Can't connect to any repository - git-receive-pack not permitted".
git config parameters in Eclipse include the following http config:
http.sslCert=/home/tim/keys/ssl-client.full.pem
sslCertPassword=false
sslKey=/home/tim/keys/ssl-client.key
sslVerify=false
Since these settings work fine using git push
from command line this proves that the configuration is correct. What else do I need to configure in Eclipse to have Eclipse push successfully?
(Note also that attempting to clone or pull from the remote repo with SSL client authentication active results in the similar behaviour - works fine with git from command line but not with Eclipse.)
Update: nginx web server provides https access to the remote repo and the nginx log shows this:
"GET /TimLearning/learning.git/info/refs?service=git-receive-pack HTTP/1.1" 403 153 "-" "JGit/5.7.0.202003110725-r" "-"
When I copy the URL into a browser and prefix it with my server URL, the browser pops up the standard basic authentication (username/password) window. When I enter username/password it returns a web page with this:
f285f5e7cd96a94a94caaa199cc97a7e78832e3b refs/heads/master
which is the correct response. So it seems that when Eclipse attempts to push, it invokes jgit to trigger git-receive-pack in order to get the above info but fails because jgit does not pass the required username/password. A clue. I wonder how to configure Eclipse to pass the required credentials to jgit?