When I am using this code to parse a rss xml source(the app using embedded tomcat and running in CentOS 7.x, using Java 11 AdoptJDK):
package com.dolphin.soa.post;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
import lombok.extern.slf4j.Slf4j;
import java.net.URL;
/**
* @author dolphin
*/
@Slf4j
public class MiniExample {
public static void main(String[] args) {
try {
URL url = new URL("https://zpblogs.cn/feed/");
SyndFeed feed = new SyndFeedInput().build(new XmlReader(url));
System.out.print(feed.getCopyright());
}catch (Exception e){
log.error("error",e);
}
}
}
this is the package I am using:
api "com.rometools:rome:1.15.0"
but show this error:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
why woud this happen? I have read this question, all tell that should using keytool to import the cert, but my rrs url has more than 1000000+, import the cert one by one, seems it hard to implement? what should I do to fix this problem?
- How much certificate organization the Java trust?
- How java determine which certificate organization should trust?
- how to know the certificate in the trust chain?
- Is it a good practice to trust all certificate?