我在某些Android设备上遇到有关使用modernhttpclient
进行HTTPS通话的问题。
请求在4.2.2上失败,但在5.1.1上有效 这是堆栈。
Digicert信任并提供服务器证书。
System.out] propertyValue:true
[System.out] [CDS]rx timeout:0
[System.out] [socket][2] connection myadress.myserver.com/someiphere:443;LocalPort=54298(0)
[System.out] [CDS]blocking mode socket with zero timeout
[System.out] [CDS]connect[myadress.myserver.com/someiphere:443]
[Posix] [Posix_connect Debug]Process com.package.name :443
[System.out] [CDS]port[54298]
[System.out] [socket][/172.20.10.8:54298] connected
[NativeCrypto] ssl=0x61c797b8 NativeCrypto_SSL_do_handshake fd=0x1eb00005 shc=0x1f600009 timeout_millis=0 client_mode=1 npn=0x0
[NativeCrypto] doing handshake ++
[NativeCrypto] ssl=0x61c797b8 info_callback where=0x10 ret=1
[NativeCrypto] ssl=0x61c797b8 handshake start in UNKWN before/connect initialization
[NativeCrypto] ssl=0x61c797b8 info_callback ignored
[NativeCrypto] ssl=0x61c797b8 info_callback where=0x1001 ret=1
[NativeCrypto] ssl=0x61c797b8 SSL_connect:UNKWN before/connect initialization
[NativeCrypto] ssl=0x61c797b8 info_callback ignored
[NativeCrypto] ssl=0x61c797b8 info_callback where=0x1001 ret=1
[NativeCrypto] ssl=0x61c797b8 SSL_connect:23WCHA SSLv2/v3 write client hello A
[NativeCrypto] ssl=0x61c797b8 info_callback ignored
[NativeCrypto] ssl=0x61c797b8 info_callback where=0x1002 ret=-1
[NativeCrypto] ssl=0x61c797b8 SSL_connect:error exit in 23RSHA SSLv2/v3 read server hello A
[NativeCrypto] ssl=0x61c797b8 info_callback ignored
[NativeCrypto] doing handshake -- ret=-1
[NativeCrypto] ssl=0x61c797b8 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=0
[NativeCrypto] sslSelect type=READ fd=72 appData=0x61c7a898 timeout_millis=0
[NativeCrypto] sslSelect READ fd=72 appData=0x61c7a898 timeout_millis=0 => 1
[NativeCrypto] doing handshake ++
[NativeCrypto] ssl=0x61c797b8 info_callback where=0x1002 ret=-1
[NativeCrypto] ssl=0x61c797b8 SSL_connect:error exit in 23RSHA SSLv2/v3 read server hello A
[NativeCrypto] ssl=0x61c797b8 info_callback ignored
[NativeCrypto] doing handshake -- ret=-1
[NativeCrypto] ssl=0x61c797b8 NativeCrypto_SSL_do_handshake ret=-1 errno=104 sslError=5 timeout_millis=0
[NativeCrypto] Unknown error during handshake
[NativeCrypto] ssl=0x61c797b8 NativeCrypto_SSL_do_handshake unclean error => 0
[NativeCrypto] ssl=0x61c797b8 NativeCrypto_SSL_interrupt
[NativeCrypto] sslNotify, appData=0x61c7a898 ret=1
[NativeCrypto] sslNotify, appData=0x61c7a898 ret=1
[System.out] [CDS]close[54298]
[System.out] close [socket][/0.0.0.0:54298]
[System.out] [CDS]rx timeout:0
答案 0 :(得分:0)
我对不受信任的证书有相同的错误(即为不同的公共名称(CN)生成)。使用具有正确CN的相同服务器它可以工作。