我正在尝试使用Play插件设置Jenkins CI,该插件使用播放自动测试来运行应用程序。使用SSL进行自动测试java java密钥存储区的问题
问题是我也有SSL作为要求,但firephoque java测试浏览器没有适当的密钥/证书使用。
我最初使用OpenSSL创建了一个密钥/证书对,但现在需要弄清楚如何将这些密钥导入到全局默认Java密钥存储区(推测在$ HOME/.keystore中)。
我在不同的顺序无济于事尝试这些资源:
发挥原有谷歌组线程我开始:http://bit.ly/yZBezu
http://www.sslshopper.com/article-how-to-create-a-self-signed-certificate-using-java-keytool.html
http://www.agentbob.info/agentbob/79-AB.html
http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/keytool.html
我可以通过SSL运行应用程序n中发挥运动员在application.conf条目拿起密钥库的位置,但在自动测试运行firephoque浏览器我得到:
The application does not start. There are errors:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
很想在一个简洁的方式做的方向指出这个,我的大脑被炸DER和PEM的视觉和keytool的乐趣,现在我无法想象得很直。
最终目标是一个自签名证书,它将根据play auto-test
以及其他任何运行该应用的方式进行验证。
我application.conf文件有以下的不同组合:
# SSL - localhost default
# original way worked fine before auto-test came into play (so to speak :))
# certificate.key.file=conf/play_host.key
# certificate.file=conf/play_host.crt
# Keystore
ssl.KeyManagerFactory.algorithm=SunX509
trustmanager.algorithm=JKS
keystore.password=passw0rd
keystore.file=conf/keystore.jks
https.port=9443
UPDATE 的conf/keystore.jks的输出:
# keytool -list -keystore keystore.jks
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
localhost, Jan 31, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): 36:EF:63:4E:53:23:18:22:13:8C:2C:DB:F1:72:2C:93
但不访问该文件通过在自动测试中运行的浏览器,它是firephoque,它是一个Java应用程序,它通过默认密钥库进行查看 - 做了更多挖掘并开始查看
/Library/Java/Home/lib/security/
其符号链接
/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security
寻找到任何应用程序将能够找到一个密钥存储的位置。但是如果我在上面的security
文件夹中放置另一个密钥库,我仍然会得到相同的结果。
更新2:也试图
play auto-test -Xmx1g -Djavax.net.ssl.trustStore=/path/to/keystore.jks
,但我不知道我这样做是正确。我怎样才能启动播放自动测试以在明确的地方查找密钥存储?
不是说它确实有帮助,但是它们的错误跟踪系统中有一张票,它描述了这个问题。一个修复它的存在,但计划为1.2.5这是还没有出来:https://play.lighthouseapp.com/projects/57987/tickets/995 – dertoni 2012-02-01 07:31:34
谢谢dertoni - 最后我修补了我的游戏副本1.2.4使用新的base.py文件,即使在配置SSL时也允许运行自动测试。现在就像魅力一样。 – Brian 2012-02-01 19:20:42