天工造物局
Getting error "No subject alternative names" when doing secure URL connection(针对处理https连接的安全异常)(转:http://www.coderanch.com/t/134
Getting error "No subject alternative names" when doing secure URL connection(针对处理https连接的安全异常)(转:http://www.coderanch.com/t/134
Getting error "No subject alternative names" when doing secure URL connection
| I believe that, by default, the HTTPS URL classes closely follow the rules laid out for checking server identity in section 3.1 of RFC 2818. I believe the error message you recieve indicates those identity checks fail. In general, if you specify a URL of "https://www.server.net", then the certificate sent back from that server should contain a special field called the "Subject Alternative Name", and furthermore the value of this field should be www.server.net. In lieu of this, it may contain www.server.net in one of the CN fields of the subject name. But please see RFC 2818 for the actual rules. If neither of these is true, I think you receive the error you got. To see if this is indeed the problem, you can temporarily disable the hostname check by using a custom hostname verifier that always returns true. NOTE: this is just for testing, don't do this in your real application! Here is a small example showing this:
| |
|
Nice to meet you. | |
更多推荐
- · deck.gl TripsLayer 出租车轨迹动画示例实战:从示例运行到着色器原理
- · Foundry Anvil 中 eth_simulateV1 的 Blob 交易与 Blob Gas 字段规范化:原理、实现与测试验证
- · LMCache CLI 实战:用 `lmcache kvcache clear` 管理运行中服务的 KV Cache 状态
2407
0
0
- 0
扫一扫分享内容
分享
回到
顶部
顶部
所有评论(0)