当我尝试下载PDF文件时,我使用了以下代码
final String fileURL = "url";
final String filepath ="C:\\FileDownload\\";
final String FILENAME = "data.pdf";
File file = new File(filepath + FILENAME);
URL url = new URL(fileURL);
try {
FileUtils.copyURLToFile(url, file);
} catch (Exception x)
{ x.printStackTrace(); }
得到的错误是,
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
可以帮助您解决此问题。