Fiddler as proxy for java giving -PKIX path building failed - error!!

1 posts, 0 answers
  1. Pratheesh
    Pratheesh avatar
    1 posts
    Member since:
    Jun 2017

    Posted 29 Jun 2017 Link to this post

    I am trying to use fiddler as a proxy for my java application that uses HTTPS connection. I had enabled proxy settings(HTTPS&Connections) on Fiddler and exported the Fiddler ROOT certificate successfully to my java keystore(cacerts). However when I run my application it is throwing following error:

    Exception in thread "main" PKIX path building failed: unable to find valid certification path to requested target<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>at com.teknowmics.jcloudplugin.FiddlerConnectorTest.main(<br>Caused by: PKIX path building failed: unable to find valid certification path to requested target<br>at<br>at<br>at<br>at<br>at<br>at<br>at<br>... 13 more<br>Caused by: unable to find valid certification path to requested target<br>at<br>at<br>at<br>at<br>... 19 more

    Sample code I used:

    public static void main(String args[]) throws MalformedURLException, IOException {<br>        System.setProperty("https.proxySet","true");<br>        System.setProperty("https.proxyHost", "");<br>        System.setProperty("https.proxyPort", "8888");<br>        System.setProperty("", "d:\\SmartDocs\\installed\\jdk1.8.0Lambda\\jre\\lib\\security\\cacerts");<br>        System.setProperty("", "changeit");<br>        System.out.println("Trust store:"+System.getProperty(""));<br>        System.out.println("Trust store pwd:"+System.getProperty(""));<br>        String https_url = "";<br>        URL url;<br>        url = new URL(https_url);<br>        HttpsURLConnection con = (HttpsURLConnection) url.openConnection();<br>        if(con!=null){<br>   System.out.println("****** Content of the URL ********");<br>   BufferedReader br =new BufferedReader(new InputStreamReader(con.getInputStream()));<br>   String input;<br>   while ((input = br.readLine()) != null){<br>      System.out.println(input);<br>   }<br>   br.close();<br>       }<br>    }<br>


Back to Top