我们正在使用clj-http
由带有自签名证书的 keystore.pfx 组成的密钥库:
(let [url (str url "api/fetch")
opts {:keystore "keystore.pfx"
:keystore-type "pkcs12"
:keystore-pass "****"
:body (json/encode {:method "yada"})
:content-type :json
:throw-entire-message? true
:async? false}
response (http/post url opts)]
(-> response
:body
base64-decode))
使用密钥库的 API 调用在本地工作以使用客户端证书调用 API,但不适用于 Kubernetes 上的 Docker。
例外是:
sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径
任何想法如何解决?我们是否需要以某种方式将其添加到 JVM 中?如果是这样,在哪里以及如何添加 pfx?