【发布时间】:2015-12-16 04:59:52
【问题描述】:
使用 jetty 9.1.2 和 [1] 中的文档,我按照使用 openssl 的步骤进行操作,但无法使 ssl 正常工作。
我已经按照链接运行了以下步骤:
我在 jetty 文件夹中,debian 7。
cd etc
rm keystore
openssl genrsa -des3 -out jetty.key
openssl req -new -x509 -key jetty.key -out jetty.crt
keytool -keystore keystore -import -alias jetty -file jetty.crt -trustcacerts
openssl pkcs12 -inkey jetty.key -in jetty.crt -export -out jetty.pkcs12
keytool -importkeystore -srckeystore jetty.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
cd..
然后根据 [1],它说将此 xml 添加到 jetty-https.xml 但添加到哪里?
<New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
<Set name="KeyStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
<Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
<Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
<Set name="TrustStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
<Set name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
</New>
我还在 start.ini 中添加了 etc/jetty-https.xml
java -jar start.jar
错误:jetty-https.xml java.lang.reflect.InvocationTargetException
文档中是否缺少某些内容?让新码头在 https 上工作的完整设置是什么?
【问题讨论】:
-
为了帮助别人,玩了一些之后发现我不需要使用指定的xml,我只是更新了jetty-ssl.xml并将其添加到start.ini:etc/jetty-ssl。 xml etc/jetty-https.xml
-
这很好,因为如果没有您应该发布的堆栈跟踪,InvocationTargetException 就不会告诉我们任何信息。