First of all, I know this was asked before but I'e tried the solutions proposed and got no results.
I'm trying to develop a simple program in java where it connects to a website and reads from a text file hosted there. At first I thought the certificate would cause problems because I can't open the website on firefox without receiving a warning. Internet explorer doesn't create any issue. The code is the following:
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.*;
public class insig
{
public static void main(String[] args) throws IOException
{
URL fpath = new URL("website/test.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fpath.openStream()));
String Reader = null;
while((Reader = br.readLine()) != null)
{
System.out.println(Reader);
}
}
}
The first thing I tried was the solution presented on Java: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, with no sucess. Tried to debug, and although I do not understand this really well, with the help of this http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/ReadDebug.html I was able to understand that everthing goes accordingly until the part of finding a trusted certificate. Already checked if I added the certificate to the correct version of the jre and still have the same problem.
Could the problem be solved with the website owner? It just because this won't be run only in my PC, so it is not convenient to configure everything again on every PC this runs.