【问题标题】:RestTemplate certificate issueRestTemplate 证书问题
【发布时间】:2018-01-05 03:15:06
【问题描述】:

我在 RestTemplate 请求标头中传递证书。我收到 403 禁止错误。在调用 Web 服务之前,如何在我的端显示证书信息?我正在使用下面的代码在请求标头中传递证书。

What is the right way to send a client certificate with every request made by the resttemplate in spring?

【问题讨论】:

    标签: ssl spring-boot https resttemplate


    【解决方案1】:

    不确定 403,因为我是证书和东西的新手,但是对于您的其他问题(我知道这已经晚了,但可能会帮助遇到此页面的人):

    用于检查的 Java Keytool 命令:

    JDK自带keytool

    如果您需要检查证书或 Java 密钥库中的信息,请使用这些命令。

    检查独立证书:

    keytool -printcert -v -file mydomain.crt

    检查 Java 密钥库中有哪些证书:

    keytool -list -v -keystore keystore.jks

    使用别名检查特定的密钥库条目:

    keytool -list -v -keystore keystore.jks -alias mydomain

    首先,我建议在您的 REST 客户端中通过导入证书和密钥文件来验证您是否能够访问 REST 端点:

    https://www.getpostman.com/docs/v6/postman/sending_api_requests/certificates

    有用的链接:

    https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html

    【讨论】:

      猜你喜欢
      • 2016-02-03
      • 2018-02-27
      • 2023-04-07
      • 2014-09-06
      • 2011-10-18
      • 2021-10-14
      • 2011-07-20
      相关资源
      最近更新 更多