anthony44
anthony44

Reputation: 347

How to bootstrap spring cloud config server with Private Github repository?

I need to connect spring cloud server to my private github repository. I get an error "Reason: Property 'spring.cloud.config.server.git.privateKey' is not a valid private key"

Steps:

spring:
   cloud:
    config:
      server:
        git:
          uri: [email protected]:[repository]/config-repo.git
          searchPaths: '{application}'
          hostKey: someHostKey
          hostKeyAlgorithm: ssh-rsa
          ignoreLocalSshSettings: true
          privateKey: |
                      -----BEGIN RSA PRIVATE KEY-----
                      [...]
                      -----END RSA PRIVATE KEY-----

Could you help me to startup my server ? Thanks a lot

Upvotes: 6

Views: 5343

Answers (3)

evren
evren

Reputation: 140

I had the same problem and solved my issue with adding the passphrase (the one us) solve my issue.

spring.cloud.config.server.git.passphrase=yourPassphrase

PS: I am using .properties instead of .yml.

Upvotes: 1

rud
rud

Reputation: 1020

You need to store the key-pair in the PEM format. This was the default a while back, but these days you have to specify it when you invoke ssh-keygen.

An example:

ssh-keygen -m PEM -t rsa -b 4096 -C "[email protected]"

The private key you get out then starts with:

-----BEGIN RSA PRIVATE KEY-----
...

Upvotes: 1

JPG
JPG

Reputation: 988

I was facing the same ... I was generating my keys with Linux ssh-keygen

I generated keys and not more Reason: Property 'spring.cloud.config.server.git.privateKey' is not a valid private key error

Upvotes: 1

Related Questions