Ssl 获取站点时遇到问题';s https证书

Ssl 获取站点时遇到问题';s https证书,ssl,openssl,Ssl,Openssl,我有一个Android应用程序,当通过https连接时,它在站点证书方面遇到了一些问题。因为即使在使用带有证书的自定义密钥库(“无对等证书”)时,我也遇到了问题,所以我正在尝试获取有关服务器实际提供的连接、握手和证书的更多信息 openssl的版本如下: $ openssl version OpenSSL 1.0.1e 11 Feb 2013 当我尝试获取有关证书的信息时,我得到以下响应: $ openssl s_client -showcerts -connect [hostname]:44

我有一个Android应用程序,当通过https连接时,它在站点证书方面遇到了一些问题。因为即使在使用带有证书的自定义密钥库(“无对等证书”)时,我也遇到了问题,所以我正在尝试获取有关服务器实际提供的连接、握手和证书的更多信息

openssl的版本如下:

$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
当我尝试获取有关证书的信息时,我得到以下响应:

$ openssl s_client -showcerts -connect [hostname]:443 </dev/null
CONNECTED(00000003)
3069977808:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:749:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 308 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

有人根据给出的信息得到任何提示吗?

这可能是SNI问题,服务器没有为非SNI客户端定义默认证书。Android包含一个已知不支持SNI的Apaches httpclient版本,并且您的
openssl s_client
命令也不使用SNI


请尝试
openssl s_客户端-服务器名主机名-连接…
使用SNI,看看这是否有帮助。

哇,看来你已经成功了!非常感谢-我用SNI拿到了证书。有点离题,但您似乎对这个主题了解了一些:当我从Apache的httpclient获得“无对等证书”时,您知道这是否是因为SNI问题?我看到服务器没有返回中间证书或任何东西。是的,这可能也是由于Android附带的ApacheHttpClient中缺少SNI支持造成的。有关可能的解决方法,请参见。
$ openssl s_client -showcerts -connect [hostname]:443 -tls1_2 -cipher RC4-MD5
CONNECTED(00000003)
3069396176:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1258:SSL alert number 40
3069396176:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1414399499
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---