Posts: 2
Joined: Tue Jan 29, 2019 3:32 pm When coding on Pi

Tue Jan 29, 2019 3:40 pm

Hello, I am using java to read from a webpage using this code:

Code: Select all


public class URLReader {
    public static void main(String[] args) throws Exception {

        URL oracle = new URL("");
        BufferedReader in = new BufferedReader(
        new InputStreamReader(oracle.openStream()));

        String inputLine;
        while ((inputLine = in.readLine()) != null)
When I run the code, I get this error:

Code: Select all PKIX path building failed: unable to find valid certification path to requested target
I think it means java doesn’t trust the website, but I can’t find a solution anywhere. Any help would be greatly appreciated.

Return to “Java”