我是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支持:
//生成证书签名请求
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
//启动play并使用系统参数运行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错误吗?