【发布时间】:2019-05-18 12:12:32
【问题描述】:
我是证书概念的新手,任何人都可以帮助如何在 https 请求中发送证书。 我的 CURL 命令如下:
curl -d "grant_type=password&client_id=SmartRest&client_secret=594a27f3-4432-4d37-9196-2ba49de52758&username=user123&password=welcome123" https://xxxxxxx.xxx.in:8543/auth/realms/restapi/protocol/openid-connect/token --cacert ./ca_bundle.crt
我需要在我的 java 代码中发送同样的东西,我只有一个 .crt 文件,我没有 keypass 或任何东西。
【问题讨论】:
-
为什么需要将 .crt 证书发送到 openid 端点?可能您需要它来验证服务器证书
-
@pedrofb - 客户端共享的 url,我只需要调用它。 curl 正在工作(主机更改)
-
--cacert验证服务器证书。它不会将证书发送到服务器。要将 curl 转换为 Java,您需要使用密钥库(JKS 或 PKCS12)并将证书包含在其中。您可以在 SO 中找到许多示例 -
您忘记提供链接
标签: java https certificate ssl-certificate