gpt4 book ai didi

java - spring cloud配置在379 : 64处抛出错误的Base64输入字符

转载 作者:行者123 更新时间:2023-12-02 11:12:52 25 4
gpt4 key购买 nike

我正在尝试在我的 Spring Boot 项目中创建一个具有以下属性的 Spring Cloud 配置服务器。

spring.cloud.config.server.git.uri=git@bitbucket.org:user/config-server.git
spring.cloud.config.server.git.ignoreLocalSshSettings=true
spring.cloud.config.server.git.privateKey=-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAsuJNmk0OKZpaZRTu8V0tZ/r/lEz386PZrwV6uQFudkr3kvUEKBY4K+/5Hx8uMrdlUG0sZ3Pn3qaYQYoK2gWqOwBEhOcpZo1sDYvSQHNWLsl5BD/YEwbctrfGUrVJquhqW/lLh1GexjkbKxMfTZapHpxX8rNor+uo/H9tS5i+EvllVzj8phsMRKN3Iv+YlRPCTRvfEiw22b6dLPyiRNSSpLs3DnaOAPxynjgK5KM+XeuWqR0BQ+BURZQVTf7aN1S9ocbrcXrikv7Vg3/tQuLX3wjAH+TI/NGMyPEj4N96SYlmXxPGHgL0gr9tJgTJWpiGrRxdUwXw8gXoLjegY8sqxQIDAQABAoIBACIJeWagvs8ftY+COizm49rjIXpgYtWTGbp5um41XYVYol7uDApsn+eMU8SeNDYmOzrgaxCMN1RgMpxV3da6OTfcxyzap0ACLMsvDaSBzaY9Y69xTnXgWmLR+QSHxiqk6ofxmXN4DlP9TbQWgWBMCIXwjbN6e7LtjkvtGyjFOXV2eR19EFfw/rgnVN1CVurDp/IhhldZSz1UleXF9WK64s3lfNK7UD/12GbubcQPYgtJdQmzH4wzbievSjufVtN4qO5aWifQWjASlyCuauohXIBjUZzfvUQYkNmkjzVsvJQZ9Etx6w/CG/py2zvGfssXqoKgDvVPaYtJhrA2MooV98kCgYEA6N++PEcCYNFEBnzhaMBwYBKXxMzvsiyWnUSRsGXRYl26CwIZgye5MgeTHGPAaMZm2BiM6fP02YXH5gi9FtWruHg+5v+bLZDXuaPSiVL/Qby9lbgTe6w1l0y5agdipNZiocjgzdko26eePQqYbigcWHBiQ0DXFq8zMkjRF0bflocCgYEAxKX+whNGWrS8qb/LvNgTS3IJvQy0zsY0ntaPbAwW0vnuhEdSGcSRNwwDeaQMtkAdeboR2fwO59wjrp2KogZ60jATB/jyLvGMlLlWhNBPMBvPX8cWMgOrQRxbrP+h09TRmrgmb8GFzy984M9jb1MI+n9acalvYQq3FCF99vBR+1MCgYAlMGYO9kAY+hJk/th4hBLuJMn78cZtq9U5tFOX2grALLujOmicm2Fl7fO+WufFU7nk1LbcPctiWYz83XRlCyZrRTi2Zyd+9VyeFt1udMSy2NNl74mc/HlqeiQ6HIfSTzJdJ9lOxllSCsiocuK45MryDLCEkPxIcR4574sErprSTQKBgQDCk/lrcYUI1ZNkZ4oh9q/I1DL8o+j4PLjufiF16NRgt7shmiyLoKuLi1CY+RE2+GPyAYIOblEVbQbFjc8SGVVISxdZqSOB/bJ7qpQIYNIqKSpde/HjVSwMBhJUMLGgmBE6hYJKzHMpmbR4Ad1C1yeoLYGBvASgQej7e1RXll2YTwKBgQC7pCTX1a68Cq01gK/4k/Zz9YMAhiqJxx2RuCN9APtBgTT8qMjUE0pyqBS40l8KVRUhQQQIs8ybhaiiuFR1V0JJPph35PER6zRgTeN3X97qcFcR66wIb3pd0HCApd13eQEC4opk++dAzDC2L+Wp5MJulqZQucufdC+qhA38cj3/GA==-----END RSA PRIVATE KEY-----
spring.cloud.config.server.git.cloneOnStart=true
spring.cloud.config.server.git.hostKey=AAAAB3NzaC1yc2EAAAADAQABAAABAQCy4k2aTQ4pmlplFO7xXS1n+v+UTPfzo9mvBXq5AW52SveS9QQoFjgr7/kfHy4yt2VQbSxnc+fepphBigraBao7AESE5ylmjWwNi9JAc1YuyXkEP9gTBty2t8ZStUmq6Gpb+UuHUZ7GORsrEx9NlqkenFfys2iv66j8f21LmL4S+WVXOPymGwxEo3ci/5iVE8JNG98SLDbZvp0s/KJE1JKkuzcOdo4A/HKeOArkoz5d65apHQFD4FRFlBVN/to3VL2hxutxeuKS/tWDf+1C4tffCMAf5Mj80YzI8SPg33pJiWZfE8YeAvSCv20mBMlamIatHF1TBfDyBeguN6BjyyrF Zombie@DESKTOP-1T6OJ80
spring.cloud.config.server.git.hostKeyAlgorithm=ssh-rsa

使用 git bash 中的 sh-keygen 实用程序生成 key 。我将 id_rsa.pub 文件内容粘贴到 bitbucket ssh key 部分。

运行此 Spring Boot 应用程序时,我遇到以下异常

Caused by: java.lang.IllegalArgumentException: Bad Base64 input character at 379 : 64 (decimal)
at org.eclipse.jgit.util.Base64.decode(Base64.java:276) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
at org.eclipse.jgit.util.Base64.decode(Base64.java:298) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
at org.springframework.cloud.config.server.ssh.PropertyBasedSshSessionFactory.createSession(PropertyBasedSshSessionFactory.java:80) ~[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT]
at org.eclipse.jgit.transport.JschConfigSessionFactory.createSession(JschConfigSessionFactory.java:199) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:129) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280) ~[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r]
... 122 common frames omitted

配置是否有问题,或者传递主机 key 时需要任何编码?

最佳答案

请勿在主机 key 中包含 Zombie@DESKTOP-1T6OJ80 部分。它应该只是 Base64 部分,并且它反对 @

并且,正如 @Konrad 在评论中指出的那样,如果这些是您的 key ,它们将不再可用,您必须生成新 key 。

关于java - spring cloud配置在379 : 64处抛出错误的Base64输入字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50493797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com