SSL连接问题与s_client

我试图从我创build的本地CA两台机器上(局域网)configurationSSL,并用s_client进行testing时遇到问题,我似乎无法find有用的信息瓦特/我的谷歌技能。 我试图熟悉信息安全,似乎是一个很好的开始。 我的情况是

host1:Ubuntu 12.04,tomcat7

host2:Ubuntu 12.04,tomcat7

在两台主机上都configuration了tomcat w / ssl,并且可以从任一台机器到达tomcat主页@ https:// {host}:8443。 我configuration了连接器w /我的keystore&通过,我相信tomcat很高兴的参数,因为我有tomcat启动错误不能提取私钥,但已解决。 这是我做的

// create tomcat server keystore 1. sudo keytool -genkey -alias tomcat7 -keyalg rsa -keystore /etc/tomcat7/keystore/host1.jks 2. openssl genrsa -aes256 -out host1_key.pem 2048 3. openssl req -new -key host1_key.pem -out host1.csr 4. openssl x509 -req -days 3650 -in host1.csr -CA root_ca.cer -CAkey root_ca_key.pem - CAcreateserial -setalias host1 -addtrust serverAuth -addtrust clientAuth -extensions client -outform PEM -out host1.cer // export to keystore 5. openssl pkcs12 -export -in host1.cer -inkey host1_key.pem -out host1.p12 -name "host1" // import keystore 6. sudo keytool -importkeystore -srckeystore host1.p12 -destkeystore /etc/tomcat7/keystore/host1.jks -srcstoretype pkcs12 dest passwd: src passwd: Entry for alias host1 successfully imported Import command completed: 1 entries successfully imported, 0 entries failed or cancelled 7. view keystore host1.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 2 entries tomcat7, Feb 18, 2013, PrivateKeyEntry, Certificate fingerprint (MD5): 2A:F1:5A:D1:5B:B1:24:5E:C7:96:3F:71:C8:17:09:E8 host1, Feb 18, 2013, PrivateKeyEntry, Certificate fingerprint (MD5): 3F:81:FD:79:78:85:98:32:72:C4:42:8F:D6:2F:DD:09 8. Configure connector in tomcat w/ this keystore. restart tomcat. Boots w/out error. Browse to https://host1:8443 from host2 and will get to "It Works!" page 

我做的下一步是testing从一台机器到另一台机器的连接

 host2: openssl s_client -connect host1:8443 CONNECTED(00000003) 140310470641312:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error:s23_clnt.c:724: --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 7 bytes and written 226 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE --- 

在Wireshark中,我为所有的TLS协议(“ssl.record.version == 0x0301”)设置了我的filter,当我运行上面的命令时,我甚至看不到请求。 我认为这意味着openssl不能提取我的证书? 我不知道从哪里看,如果我在我的tomcat连接器中将我的密钥库密码更改为无效,我将在启动时看到tomcat中的错误。 否则,我应该看到wireshark的握手请求。

我会看到相同的,如果我尝试从我的另一台主机。

当我尝试解决我的问题时,我已经阅读了有关“truststores”的信息,这是否是另一个密钥库/其他服务器的.p12导入和本地CA?

谢谢,任何方向都会有帮助。

你可以在server.xml设置哪些密码被接受,例如

  SSLCipherSuite="ALL:!ADH:!SSLv2:!EXPORT40:!EXP:!LOW" 

不包括SSLv2。 Techstacks有更多的信息