请考虑两个curl
命令:
curl-v--sslhttps://example.com
* About to connect() to example.com port 443 (#0)
* Trying 10.20.30.40...
* connected
* Connected to example.com (10.20.30.40) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
* Closing connection #0
curl: (35) error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
curl-v-3--sslhttps://example.com
About to connect() to example.com port 443 (#0)
* Trying 10.20.30.40...
* connected
* Connected to example.com (10.20.30.40) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: (certificate token etc.)
* start date: 2013-03-24 12:59:13 GMT
* expire date: 2014-03-28 05:41:38 GMT
* subjectAltName: example.com matched
* issuer: C=US; O=GeoTrust, Inc.; CN=RapidSSL CA
* SSL certificate verify ok.
> GET /status.php HTTP/1.1
> User-Agent: curl/7.25.0 (x86_64-unknown-linux-gnu) libcurl/7.25.0 OpenSSL/0.9.8o zlib/1.2.7 libidn/1.15 libssh2/1.2.6
> Host: example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 23 Sep 2013 11:00:51 GMT
< Server: Apache
< Content-Length: 195
< Connection: close
< Content-Type: text/plain; charset=utf-8
<
(html there)
* Closing connection #0
* SSLv3, TLS alert, Client hello (1)
参数:
-v
= 详细--ssl
= 使用 SSL-3
= 使用 SSLv3
问题是:为什么会出现这样的SSL23_GET_SERVER_HELLO:reason(1112)
错误?如何修复?是客户端还是服务器(https 服务器)的问题?
我不介意使用带-3
参数的 curl,但使用 PHPfile_get_contents()
函数时也会出现同样的问题。我知道 PHP 有解决方法,但我想让事情正确完成。
答案1
我发现这个问题
服务器名称 example.com:443
ssl.conf
配置中缺失