Android异常处理:
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x41ea4068: Failure in SSL library, usually a protocol error
log如下:
10-19 17:40:47.610 805-826/com.example.ipawsplay W/System.err: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x44a59d5c:0x00000000)
10-19 17:40:47.610 805-826/com.example.ipawsplay W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
10-19 17:40:47.610 805-826/com.example.ipawsplay W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
10-19 17:40:47.610 805-826/com.example.ipawsplay W/System.err: ... 23 more
10-19 17:40:47.610 805-826/com.example.ipawsplay I/HttpContecterService: tongfei2 定时器请求 data=null
10-19 17:40:47.610 805-826/com.example.ipawsplay W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at org.a.e.b(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at org.a.e.c(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at org.a.e.d(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at org.a.c.<init>(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at org.a.c.<init>(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at com.example.ipawsplay.HttpContecterService.a(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at com.example.ipawsplay.HttpContecterService.a(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at com.example.ipawsplay.HttpContecterService$2.run(Unknown Source)
10-19 17:40:47.620 805-826/com.example.ipawsplay W/System.err: at java.util.Timer$TimerImpl.run(Timer.java:284)
10-19 17:40:57.160 805-826/com.example.ipawsplay D/ContentValues: tongfei client
10-19 17:40:57.160 805-826/com.example.ipawsplay D/ContentValues: tongfei request=Request{method=GET, url=https://www.fema.gov/api/open/v1/IpawsArchivedAlerts?$filter=sent%20gt%20%272021-10-11T19:26:00-04:00%27%20&$select=sent,status,msgType,sender,scope,info&$top=1, tag=null}
10-19 17:40:57.600 805-826/com.example.ipawsplay D/ContentValues: tongfei 抛出异常
10-19 17:40:57.600 805-826/com.example.ipawsplay W/System.err: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x41eb3490: Failure in SSL library, usually a protocol error
解决措施:
因为标准安全协议版本低slv1.0,所以需要添加一个升级的版本slv1.2