Spring cloud config using ssh instead of https

Viewed 184

I am banging my head around why spring cloud config is using ssh even when i try to provide https uri in the application.yaml. Here's my quick config file:

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/myOrg/myRepo
          skipSslValidation: true
          username: ${GITHUB_USERNAME}
          password: ${GITHUB_PASSWORD}

server:
  port: 8888
  ssl:
    enabled: false

I would assume spring cloud config to use https to do this connection and clone the repo. Can someone help me understand why still it uses ssh and fails on auth(which is obvious as I don't provide any private key):

org.springframework.cloud.config.server.environment.NoSuchRepositoryException: Cannot clone or checkout repository: https://github.com/myOrg/myRepo
    at org.springframework.cloud.config.server.environment...
    
Caused by: org.eclipse.jgit.api.errors.TransportException: git@github.com:myOrg/myRepo: Auth fail
    ....

Caused by: com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(Session.java:519) ~[jsch-0.1.55.jar:na]
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:115) ~[org.eclipse.jgit.ssh.jsch-5.12.0.202106070339-r.jar:5.12.0.202106070339-r]
    ... 62 common frames omitted

My suspicion is that if https doesn't work, it tries via ssh. That's why it's using ssh. Has anyone faced issues like this?

Any help appreciated!

1 Answers

Answering my own question. Apparently, the fallback was due to the ~/.git folder in which ssh access was recommended. Deleting it solved the problem.

Related