连接到 https 站点(服务器)
我有一些 java-app,我想建立到某个 https 站点的连接,我该如何使用 URLConnection 来做到这一点?当使用有效的证书颁发机构签署此站点的证书时,我是否应该使用信任存储?
I have some java-app, and i want to establish a connection to some https Site, how can i do this, using URLConnection? Should i use trust store, when certificate from this site was signed using a valid certificate authority?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。 URLConnection 应该可以工作。例如,
JRE 附带一个包含大多数 CA 证书的默认信任存储。只要证书是由其中之一签署的,您就不需要做任何特殊的事情。
Yes. URLConnection should work. For example,
JRE comes with a default trust store with most of the CA certs. As long as the cert is signed by one of them, you don't need to do anything special.