刷机后第一次开机时,请求服务器数据会产生异常

 W/System.err: javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: nullW/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:409)W/System.err:     at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:319)W/System.err:     at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:283)W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:168)W/System.err:     at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)W/System.err:     at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)W/System.err:     at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)W/System.err:     at com.umeox.watch.apiclient.http.TokenInterceptor.intercept(TokenInterceptor.java:51)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)W/System.err:     at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)W/System.err:     at okhttp3.RealCall.execute(RealCall.java:92)

这是由于请求Https协议网址,由于需要校验证书。证书过期导致(系统时间错误)

可以通过以下方式同步时间:

一、获取网络建立连接的时间

    /*** 同步网络时间*/public void setSystemClockTime() {try {URL url1 = new URL("http://www.baidu.com/");URLConnection conn = url1.openConnection();conn.connect();SystemClock.setCurrentTimeMillis(conn.getDate());} catch (Exception e) {e.printStackTrace();}}

二、通过NTP同步时间TrueTime

以上是针对急于请求服务器数据的情况,比如Launcher应用,一般手机把自动同步时间开关打开就可以解决

ExtCertPathValidatorException: Could not validate certificate: null相关推荐

  1. ExtCertPathValidatorException: Could not validate certificate

    javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidator ...

  2. android ExtCertPathValidatorException: Could not validate

    一个奇怪的bug 证书错误? com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: com.androi ...

  3. go发送smtp邮件时的踩坑记录——auth login、x509: cannot validate certificate for错误

    最近在用go写一个小工具,一个小功能是用smtp发邮件,用公司内网的邮箱服务器实现踩了不少坑 想知道x509: cannot validate certificate for解决的直接看2.2.1,想 ...

  4. Error response from daemon: Get https://192.168.x.x/v2/: x509: cannot validate certificate for

    docker login 时报错: Error response from daemon: Get https://192.168.x.x/v2/: x509: cannot validate cer ...

  5. Docker login私有仓库报错:x509: cannot validate certificate for because it doesn‘t contain any IP SANs

    问题: docker login 私有仓库时报错 [01:18:02 root@node ~]#docker login 192.168.4.69 Username: admin Password: ...

  6. x509: cannot validate certificate for x.x.x.x because it doesn't contain any IP SANs 解决:

    x509: cannot validate certificate for x.x.x.x because it doesn't contain any IP SANs 解决: 一, 编辑openss ...

  7. unable to fetch metrics from node * x509: cannot validate certificate for because it doesn‘t contai

    E1214 06:55:09.483690 1 server.go:132] unable to fully scrape metrics: unable to fully scrape metric ...

  8. 登录harbor提示x509: cannot validate certificate for x.x.x.x because it doesn‘t contain any IP SANs

    安装完harbor2.4.1后,尝试用docker客户端登录,登录失败,提示x509: cannot validate certificate for 10.3.9.182 because it do ...

  9. 【docker login报错】x509: cannot validate certificate for IP地址 because it does not contain any IP SANs

    原因 如果服务器名称是 IP 地址,还会检查证书的Subject Alternative Name(SAN),因此需要创建一个包含此名称的证书. 否则,docker login 时会报如下错误: Er ...

最新文章

  1. Java学习总结:7
  2. MySQL之mysql客户端工作的批处理一些使用手法
  3. VS2015和QTcreator冲突解决办法
  4. Ext Gantt Web甘特图--自定义任务树
  5. python基础for循环和while循环(十)
  6. ai策略机器人研究a50_跟上AI研究的策略
  7. 风控建模九:一些特征工程方法及自动化工具小结
  8. mysql操作 begin 命令_MySQL基础操作
  9. JAVA基本IO操作
  10. 姓氏头像框多模板制作微信小程序源码下载,复古等等超多模板支持流量主
  11. 如何解决vue项目本地ip地址无法访问项目问题?【亲测有效】
  12. C语言中数据的表现形式及其运算
  13. 重疾险对比:“瑞泰瑞享安康” V.S. “信泰百万无忧”
  14. Codeforces Round #506 (Div. 3)题解
  15. 本地Windows系统远程连接滴滴云Linux云服务器
  16. python 删除pdf页面_使用python从新生成的pdf文件中删除空白页
  17. 创新点定义,如何写创新点
  18. 利用 Global mapper制作地图瓦片
  19. 2021年中国奶粉行业发展现状分析,行业集中度不断提升,下沉市场发展空间广阔「图」
  20. 多多情报通:拼多多可以看到什么软件?拼多多的大数据分析软件是什么?

热门文章

  1. wxpython下载安装过程
  2. 顺序表的具体使用方法.数据解构(二)
  3. MySQL必知必会——第十五章联结表
  4. 网络安全之基础入门(一)
  5. 安师大计算机系导师,安徽师范大学数学计算机科学学院导师介绍:陈付龙
  6. MBR和GUID分区表
  7. 群晖自动删除重复文件_在群晖中批量删除重复文件(零基础手把手图文)
  8. create connection SQLException, url: jdbc:mysql:///test, errorCode 1045, state 28000
  9. android7.1 打印机 (ghostscript+hpijs - hplip)
  10. 1952-2018年中国各省份人均GDP