开发者

SAXBuilder to pass an HTTPS URL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜