要使用多个证书,您可以执行以下任何操作:
- 仅从下面将每个证书添加到 ssl 配置中,如globalsign.crt和service2.crt
- 创建一个信任库,将每个证书添加到信任库,将信任库提供给 ws。这将与services.jks一样,仅在下面
- 或者 1 和 2 的组合..
要依赖公共证书,您还需要告诉 play-ws 也使用默认的信任库。
play.ws.ssl {
trustManager = {
stores = [
{ type = "PEM", path = "/path/to/cert/globalsign.crt" }
{ type = "PEM", path = "/path/to/cert/service2.crt" }
{ type = "JKS", path = "/path/to/truststore/services.jks" } #Added trust store
{ path: ${java.home}/lib/security/cacerts } # Fallback to default JSSE trust store
]
}
}
请参阅https://www.playframework.com/documentation/2.4.x/ExampleSSLConfig。
您可能需要参考以下内容来创建和管理信任库: https : //docs.oracle.com/cd/E19509-01/820-3503/6nf1il6er/index.html,https: //docs.oracle.com /cd/E19830-01/819-4712/ablqw/index.html