V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Vindroid
V2EX  ›  问与答

Android SSL HttpUrlConnection 提示 hostname "ip" was not verified

  •  
  •   Vindroid · Mar 24, 2017 · 2697 views
    This topic created in 3333 days ago, the information mentioned may be changed or developed.

    局域网内服务器使用自签名证书 server.csr Certificate Request:

    Data:
        Version: 0 (0x0)
        Subject: C=CN, ST=JiangSu, L=xxx, O=xxx, OU=xxx, CN=10.89.33.52
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    *****
                Exponent: 65537 (0x10001)
        Attributes:
            unstructuredName         :unable to print attribute
        Requested Extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Digital Signature, Non Repudiation, Key Encipherment
            X509v3 Subject Alternative Name:
                DNS:10.89.33.52
    Signature Algorithm: sha256WithRSAEncryption
         *****
    

    在 android 下通过 httpurlconnection 连接会报 hostname "10.89.33.52" was not verified ,而使用域名,再在 etc/hosts 中新增条目,却可以正常访问,有人知道这是什么情况么?

    设置的 ip 均为保留地址, server.crt 证书也导入到 android 中,浏览器能正常访问,也显示为认证通过。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 479ms · UTC 20:45 · PVG 04:45 · LAX 13:45 · JFK 16:45
    ♥ Do have faith in what you're doing.