V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Vindroid
V2EX  ›  问与答

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

  •  
  •   Vindroid · 2017-03-24 15:06:58 +08:00 · 1961 次点击
    这是一个创建于 2561 天前的主题,其中的信息可能已经有所发展或是发生改变。

    局域网内服务器使用自签名证书 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 中,浏览器能正常访问,也显示为认证通过。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1502 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:20 · PVG 01:20 · LAX 10:20 · JFK 13:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.