zoukankan      html  css  js  c++  java
  • https的那些坑

    1.时间

    一些老手机不是系统自动对时,时间错误会报错。

    com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: current time: Sun Jan 01 23:02:24 GMT+08:00 2012, validation time: Wed Nov 06 05:36:50 GMT+08:00 2013
    at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
    at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
    Caused by: javax.net.ssl.SSLHandshakeException: 

    2.httpclient

    错误:

    javax.net.ssl.SSLException:hostname in certificate didn't match:<**.**.****.com> != <*.****.com>

    解决办法:

    SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext,SSLConnectionSocktFactory.ALLOW_ALL_HOSTNAME_VERIFIER);

     参考

    https://www.jianshu.com/p/c164e92d9705

  • 相关阅读:
    笔记-归并排序
    Repeated Substring Pattern
    Assign Cookies
    Number of Boomerangs
    Paint Fence
    Path Sum III
    Valid Word Square
    Sum of Two Integers
    Find All Numbers Disappeared in an Array
    First Unique Character in a String
  • 原文地址:https://www.cnblogs.com/mamamia/p/8384367.html
Copyright © 2011-2022 走看看