当我尝试在我的Ubuntu 12.04 TLS服务器上curlSSL页面时,它不起作用:
不是ssl页面:
$ curl https://evernote.com/ -vv [the entire webpage]
ssl页面:
$ curl https://evernote.com/ -vv * About to connect() to evernote.com port 443 (#0) * Trying 204.154.94.73... connected * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * Unknown SSL protocol error in connection to evernote.com:443 * Closing connection #0 curl: (35) Unknown SSL protocol error in connection to evernote.com:443
这可以在我自己的机器(OS X)上运行。
当我通过openSSL尝试时:
$ openssl s_client -connect evernote.com:433 connect: Connection timed out connect:errno=110
openSSL版本:
$ openssl version OpenSSL 1.0.1c 10 May 2012
你似乎有一个错字。
$ openssl s_client -connect evernote.com:433
端口433未在远程主机上打开,这就是为什么你得到错误110(连接被拒绝)。
尝试使用端口443(标准HTTPS端口)来代替。
至于curl,使用evernote.com时我可以复制这个问题,但是www.evernote.com可以正常工作(尽pipe它发送一个302redirect到https://evernote.com/ 。
$ curl https://evernote.com/ -vv * About to connect() to evernote.com port 443 (#0) * Trying 204.154.94.73... * connected * Connected to evernote.com (204.154.94.73) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * NSS error -5938 (PR_END_OF_FILE_ERROR) * Encountered end of file * Closing connection #0 curl: (35) Encountered end of file
这意味着服务器终止连接。 不pipe出于什么原因,它真的不想和我们说话。
这可能不是你可以修复的东西。
有非常类似的问题 – 协议谈判中存在一个问题,这可能导致与encryption提供者(OpenSSL库)的一些错误交stream。 尝试明确设置安全协议,例如:
curl --sslv3 # OR curl --sslv2 # OR curl --tlsv1