2

The site i am using is that of a https protocol,so i want to use Ignore certificates.But I am unable to set the ignore certificate.

public class JoddHttpClientDemoApplication {
    public static void main(String[] args) throws Exception {
         SpringApplication.run(JoddHttpClientDemoApplication.class, args);
         HttpRequest request = HttpRequest.get("https://xxxxx.com?0.6891255003788694").
            header("Referer","https://xxxxx.com/x.jsp");
         HttpResponse response = request.send();
         System.out.println(response);
    }
}

I am getting an error like this,

jodd.http.HttpException: sun.security.validator.ValidatorException: PKIX path building failed

4

1 回答 1

2

切换到最新的 Jodd v3.8.1。你有以下方法:trustAllCerts. 它将信任所有证书 :) 像这样使用它:

HttpRequest
    .get("https://xxxxx.com?0.6891255003788694")
    .header("Referer","https://xxxxx.com/x.jsp")
    .trustAllCerts(true);
于 2016-12-27T09:46:34.453 回答