【问题标题】:Spring Boot - client server REST API with self-signed certificateSpring Boot - 带有自签名证书的客户端服务器 REST API
【发布时间】:2017-10-30 03:33:30
【问题描述】:

我用RestTemplateRestController为客户端和服务器制作了两个应用程序。

需要使用自签名证书加密 API,服务器端的“RestController”应仅响应签名请求。

Spring Boot RestTemplate / RestController 可以吗?

  • 怎么做
  • 在客户端
  • 在服务器端

【问题讨论】:

  • 是的,有可能,你可以在网上找到在spring boot Rest中使用ssl。如果你想使用像 RestTemplate 这样的客户端,你需要将证书添加到你的 JRE 中:lib/security/cacerts。你也可以在网上找到如何做到这一点。

标签: java spring ssl spring-boot ssl-certificate


【解决方案1】:

Spring Boot 文档提供了有关如何配置服务器的信息: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html#howto-configure-ssl

关于配置客户端 RestTemplate 见这里 (4. The Spring RestTemplate with SSL) http://www.baeldung.com/httpclient-ssl

【讨论】:

    猜你喜欢
    • 2010-11-13
    • 2011-06-11
    • 2014-06-07
    • 1970-01-01
    • 2018-02-02
    • 1970-01-01
    • 2014-05-04
    • 2021-03-17
    • 1970-01-01
    相关资源
    最近更新 更多