Yak*_*ros 4 ubuntu ssl curl openssl
我正在尝试使用 Tomcat 7 + SSL 从 AWS 中的一台服务器 (A) 连接到 AWS 中的另一台服务器 (B)。
服务器A:
服务器 B:
我正在服务器 A 中尝试以下命令:
curl https://Server.B -v
Run Code Online (Sandbox Code Playgroud)
我得到以下异常:
* Connection #0 to host test.salespredict.com left intact
yakirm@ip-10-214-10-178:~$ curl https://Server.B.com -v
* Rebuilt URL to: https://Server.B.com/
* Hostname was NOT found in DNS cache
* Trying 54.245.81.*...
* Connected to Server.B.com (54.245.81.*) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to Server.B.com:443
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to Server.B.com:443
Run Code Online (Sandbox Code Playgroud)
我试着用 OpenSSL 检查
openssl s_client -connect Server.B.Address:443
Run Code Online (Sandbox Code Playgroud)
我得到以下结果:
CONNECTED(00000003)
140284858304160:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 307 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
Run Code Online (Sandbox Code Playgroud)
如果我尝试从我自己的计算机(OS X Mavericks)连接,curl 成功但 openssl 命令返回相同。
顺便提一句
如果我正在尝试:
curl https://Server.B -v -ssl3
Run Code Online (Sandbox Code Playgroud)
它在服务器 A 上工作,但我不想指定 SSL 协议。
编辑
服务器 B - Tomcat 配置:
<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true"
enableLookups="true" maxThreads="200" port="443" keystoreFile="/var/lib/tomcat7/conf/Path/Path_keystore" keystorePass="******" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https"
secure="true" sslProtocol="TLS" />
Run Code Online (Sandbox Code Playgroud)
设置--sslv3和不设置它的主要区别在于,客户端不会在初始 ClientHello 消息中宣布支持高于 SSL3.0 的版本。通常客户端和服务器就双方都支持的版本达成一致,这样客户端宣布它支持的最佳 SSL 版本是正确的。
看起来在您的情况下,您遇到了一种情况,其中服务器(或某些中间件)不仅无法使用较新的 TLS 版本,而且也无法正确处理 SSL 3.0,因为如果客户端宣布它会发出嘶嘶声支持较新的版本。由于服务器软件本身看起来并不老,您有一个非常奇怪的服务器设置或一些无法处理正确 TLS 的中间件(即负载平衡器、防火墙...)。
如果您发布有关服务器的更多信息,则可能会获得更多信息。您也可以根据SSLLabs检查服务器。
编辑:看起来服务器支持 TLS1.* 但当客户端提供 ECDHE-RSA-AES256-SHA 密码时只是断开连接。使用openssl s_client -cipher 'ALL:!ECDHE-RSA-AES256-SHA'工作原理curl --ciphers 'ALL:!ECDHE-RSA-AES256-SHA'。我认为这是服务器端的问题 - 也许您已经配置了tomcat中的SSL实现实际上不支持的密码(这不是OpenSSL,因为Java有自己的实现)并且Java在尝试使用它们时发出噼啪声.
| 归档时间: |
|
| 查看次数: |
28138 次 |
| 最近记录: |