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
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
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-----
...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With