Java certificate issues recipe + basic java demo
✓ Published0🌍 Public
TThomasG77
Last edited Feb 10, 2023
Created on Feb 10, 2023
This example demonstrates a basic Java 11 HTTP client that retrieves dataset metadata from the data.gouv.fr API, parsing the JSON response to extract and print the URLs of all resources. The code uses `java.net.http.HttpClient`, `HttpRequest`, and `HttpResponse` for the asynchronous request, alongside the `org.json` library for JSON parsing. The accompanying recipe addresses a "PKIX path building failed" error by downloading the site’s certificate via `InstallCert.java` and importing it into the JDK 19 keystore using `keytool`, which is necessary for the HTTPS connection to succeed.
AI-generated description