java hashicorp vault导入自签名证书

ifmq2ha2  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(233)

我使用marketplace的产品在aws上运行了hashicorp vault:https://aws.amazon.com/marketplace/pp/prodview-ngzq6n42psnxa?ref_=unifiedsearch
之后我从保险库下载了证书-url:8200 and 添加时使用 sudo keytool -import -trustcacerts -keystore /usr/lib/jvm/default/lib/security/cacerts -storepass changeit -noprompt -alias hashicorp-vault-chain -file ~/Downloads/hashicorp-vault-chain.cer 但是,如果我尝试运行spring应用程序,我还是会出错:

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://vault-url:8200/v1/secret/service-discovery/local": Certificate for <vault-url> doesn't match any of the subject alternative names: []; nested exception is javax.net.ssl.SSLPeerUnverifiedException: Certificate for <vault-url> doesn't match any of the subject alternative names: []
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785) ~[spring-web-5.3.4-SNAPSHOT.jar:5.3.4-SNAPSHOT]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.4-SNAPSHOT.jar:5.3.4-SNAPSHOT]
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:334) ~[spring-web-5.3.4-SNAPSHOT.jar:5.3.4-SNAPSHOT]
    at org.springframework.vault.core.VaultTemplate.lambda$doRead$5(VaultTemplate.java:461) ~[spring-vault-core-2.3.0.jar:2.3.0]
    at org.springframework.vault.core.VaultTemplate.doWithSession(VaultTemplate.java:448) ~[spring-vault-core-2.3.0.jar:2.3.0]
    at org.springframework.vault.core.VaultTemplate.doRead(VaultTemplate.java:458) ~[spring-vault-core-2.3.0.jar:2.3.0]
    at org.springframework.vault.core.VaultTemplate.read(VaultTemplate.java:353) ~[spring-vault-core-2.3.0.jar:2.3.0]
    at org.springframework.vault.core.lease.SecretLeaseContainer.doGetSecrets(SecretLeaseContainer.java:644) ~[spring-vault-core-2.3.0.jar:2.3.0]

我该如何导入该证书?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题