- Windows 10 Pro x64
- JDK 11.0.6
- spring-cloud-config-server 2.2.2.RELEASE
Server works fine with https / username / password. With SSH, I get Auth Fail:
Caused by: org.eclipse.jgit.errors.TransportException: git@github.com:xxx/Config.git: Auth fail
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:192) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1271) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:243) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
... 24 common frames omitted
Caused by: com.jcraft.jsch.JSchException: Auth fail
at com.jcraft.jsch.Session.connect(Session.java:519) ~[jsch-0.1.54.jar:na]
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:146) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]
... 31 common frames omitted
Application.properties looks like:
spring.cloud.config.server.git.uri=git@github.com:xxx/Config.git spring.cloud.config.server.git.clone-on-start=true spring.cloud.config.server.git.strict-host-key-checking=false spring.cloud.config.server.git.skip-ssl-validation=true spring.cloud.config.server.git.ignore-local-ssh-settings=false
NOTES:
1) private / public key are created in default files and default locations 2) public key c&p'ed to github
known_hosts looks like:
github.com ssh-rsa AAAAB3N.....
id_rsa looks like:
-----BEGIN RSA PRIVATE KEY----- MIIJJwIBAAKCAgEAswJSoy+7gP0Wyv3w2etsVtAbo9sKTuZ8VuQBj68qOB83qoVa.....
id_rsa.pub looks like:
ssh-rsa AAAA....
Not sure if I need it, but I tried creating a config file too:
Host github.com HostName github.com IdentityFile ~/.ssh/id_rsa
git clone git@github.com:xxx/Config.git works via command line.
Comment From: spencergibb
Closing in favor of https://stackoverflow.com/questions/61484258/spring-cloud-jgit-github-failing-with-ssh
Please don't cross post.