我试图从godaddy获得一个ssl证书用于docker。 这些是我的步骤:
keytool -keystore keystore -alias jetty -genkey -keyalg RSA -keysize 2048 What is your first and last name?: example.com What is the name of your organizational unit?: me What is the name of your organization?: me What is the name of your City or Locality?: someplace What is the name of your State or Province?: somewhere What is the two-letter country code for this unit?: XX no?: yes
这生成我的密钥库文件。 下一个:
keytool -certreq -alias jetty -keystore keystore -file jetty.csr
这生成我的csr文件。 我现在有两个文件:
keystore jetty.csr
我用文本编辑器打开jetty.csr,复制其内容,发送到godaddy ssl服务(我selectSHA-2作为签名algorithmfwiw)。
我从两个文件得到godaddy的回应:
gd_bundle-g2-g1.crt // is this the 'public/intermediate' certificate? 123456789.crt // is this my private key? why is it named so?
现在docker上的文件说:
“你需要密钥库中的私钥和证书,你应该把证书加载到keytool中用于生成CSR的keystore中”
所以我尝试将公钥/中间证书加载到我的密钥库文件中:
keytool -import -trustcacerts -alias godaddy -keystore keystore -file gd_bundle-g2-g1.crt Trust this certificate? [no]: yes Certificate was added to keystore
这似乎工作。 我不确定什么别名,我只是猜到了“godaddy”。
最后,我尝试将私钥加载到我的密钥库文件中:
keytool -import -trustcacerts -alias jetty -keystore keystore -file 123456789.crt
这导致:
keytool error: java.lang.Exception: Failed to establish chain from reply
我不确定这是什么意思。
这是我一直在跟踪的docker文件,但是我现在看不到我要去的地方:
http://wiki.eclipse.org/Jetty/Howto/Configure_SSL#Loading_Keys_and_Certificates
谢谢你的帮助
哦天哪,s_t_e_v_e这个问题的答案是:
https://stackoverflow.com/questions/4008837/configure-ssl-on-jetty
我不知道为什么和这个东西的文档是非常狂野的,对任何人都可以自己搞清楚的荣誉!