我是 Play 新手,正在为生产配置 SSL。我可以使用自签名证书在开发模式下成功运行,但是当我尝试使用签名证书时,初始客户端握手失败并且 Play 生成以下堆栈跟踪:
play - Error loading HTTPS keystore from conf/keystore.jks
java.security.NoSuchAlgorithmException: RSA KeyManagerFactory not available
at sun.security.jca.GetInstance.getInstance(GetInstance.java:159) ~[na:1.7.0_11]
at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139) ~[na:1.7.0_11]
at play.core.server.NettyServer$PlayPipelineFactory$$anonfun$sslContext$1.apply(NettyServer.scala:74) [play_2.10.jar:2.1.1]
at play.core.server.NettyServer$PlayPipelineFactory$$anonfun$sslContext$1.apply(NettyServer.scala:62) [play_2.10.jar:2.1.1]
at scala.Option.map(Option.scala:145) [scala-library.jar:na]
at play.core.server.NettyServer$PlayPipelineFactory.sslContext$lzycompute(NettyServer.scala:62) [play_2.10.jar:2.1.1]
我正在运行 Play 2.1.1 和 Java 1.7.0_11。我已将 ssl 支持配置如下:
//生成一个csr
keytool -certreq -alias server -keyalg RSA -file server.csr -keystore keystore.jks
//加载根证书和中间证书
keytool -import -alias godaddy -keystore keystore.jks -file gd_bundle.crt
//加载签名证书
keytool -import -alias server -keystore keystore.jks -file server.crt
//使用系统参数启动播放以运行ssl
sudo ../../jars/play-2.1.1/play -Dhttps.port=443 -Dhttps.keyStore="conf/keystore.jks" -Dhttps.keyStorePassword=REDACTED -Dhttps.keyStoreAlgorithm="RSA" run
有谁知道 java.security.NoSuchAlgorithmException: RSA KeyManagerFactory not available 错误?