【问题标题】:SSL/TLS configuration with certificate带证书的 SSL/TLS 配置
【发布时间】:2019-03-13 04:55:46
【问题描述】:

我遇到了 TSL/SSL 配置问题。一切都按照文档中的配置https://cloud.spring.io/spring-cloud-gateway/multi/multi__tls_ssl.html

server:
  port: 8080
  ssl:
    enabled: true
    key-password: password
    key-store-password: password
    key-store: certificate.p12
    key-store-type: PKCS12

spring:
  cloud:
    gateway:
      httpclient:
        ssl:
          trustedX509Certificates:
            - someCert.pem

使用此配置,无法使用 http://localhost:8080/home 调用端点 - 这是一种理想的行为。

尽管进行了配置,但我可以调用所有端点,例如 https:localhost:8080/home 而无需应用适当的证书。在 chrome 中,我只需点击“继续”即可获得端点的内容。

我不想允许这个 - 如果你想从外部世界调用端点,你需要有客户端证书。这是我的目标,但我缺少一些东西。

如何使用spring cloud gateway实现?

【问题讨论】:

    标签: spring-security netty spring-cloud-config spring-cloud-gateway


    【解决方案1】:

    我知道这是旧的,但万一其他人遇到它,你错过了一个属性:

    server:
      ssl:
        client-auth: need
    

    这将强制服务器在接受连接之前要求客户端证书。

    【讨论】:

      猜你喜欢
      • 2016-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-03
      • 2021-07-30
      相关资源
      最近更新 更多