开发者

SAXBuilder to pass an HTTPS URL

开发者 https://www.devze.com 2023-02-10 03:53 出处:网络
Does anyone know how to parse an https URL to the SAXBuilder as an argument. URL url = new URL(\"https:anyURL\");

Does anyone know how to parse an https URL to the SAXBuilder as an argument.

URL url = new URL("https:anyURL");
SAXBuilder parser = new SAXBuilder();
Document doc = null;
doc = parser.build(url);

This code segment works for an http URL. But when it comes to https URL this gives an java.io.IOException: Hostname was not verified. Any help would be grea开发者_StackOverflow社区tly appreciated.


You will have to provide the Key Store path inorder to call a secure URL:

Example:

System.setProperty("javax.net.ssl.trustStore", "C:\\certificates\\xxx.jks");
0

精彩评论

暂无评论...
验证码 换一张
取 消