Bonjour,
tout d'abord merci beaucoup à l'équipe de developpez.net pour la mise en place de ce forum.

Je suis en train de mettre en place un job sur Talend qui fait appel à une API de l'IGN pour le calcul d'itinéraires : https://geoservices.ign.fr/documenta...tineraires/api

Rien qu'en faisant appel en mode GET avec un tREST à l'URL construit avec cet API, j'ai un problème de certificat.
Pourtant j'ai bien placé le certificat de l'IGN (.crt) dans le fichier CACERTS de mon Java.

Voici l'URL construit avec l'API : "https://wxs.ign.fr/calcul/geoportail/itineraire/rest/1.0.0/route?resource=bdtopo-osrm&start=2.337306%2C48.849319&end=2.367776%2C48.852891&profile=car&optimization=fastest&constraints=%7B%22constraintType%22%3A%22banned%22%2C%22key%22%3A%22wayType%22%2C%22operator%22%3A%22%3D%22%2C%22value%22%3A%22autoroute%22%7D&getSteps=true&getBbox=true&distanceUnit=kilometer&timeUnit=hour&crs=EPSG%3A4326"

Voici l'erreur que Talend renvoi :
Exception in component tREST_2 (itineraires_covoiturage)
com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
at com.sun.jersey.api.client.Client.handle(Client.java:616)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
at local_project.itineraires_covoiturage_0_1.itineraires_covoiturage.tREST_2Process(itineraires_covoiturage.java:671)
at local_project.itineraires_covoiturage_0_1.itineraires_covoiturage.runJobInTOS(itineraires_covoiturage.java:1124)
at local_project.itineraires_covoiturage_0_1.itineraires_covoiturage.main(itineraires_covoiturage.java:921)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alert.createSSLException(Unknown Source)
at sun.security.ssl.TransportContext.fatal(Unknown Source)
at sun.security.ssl.TransportContext.fatal(Unknown Source)
at sun.security.ssl.TransportContext.fatal(Unknown Source)
at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source)
at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source)
at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source)
at sun.security.ssl.SSLHandshake.consume(Unknown Source)
at sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at sun.security.ssl.TransportContext.dispatch(Unknown Source)
at sun.security.ssl.SSLTransport.decode(Unknown Source)
at sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.http://www.protocol.https.HttpsClien...onnect(Unknown Source)
at sun.net.http://www.protocol.https.AbstractDe...onnect(Unknown Source)
at sun.net.http://www.protocol.http.HttpURLConn...tream0(Unknown Source)
at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.http://www.protocol.https.HttpsURLCo...seCode(Unknown Source)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:218)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
... 6 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 26 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 32 more
[statistics] disconnected Nom : 2023-03-24_10h37_37.png
Affichages : 148
Taille : 40,0 KoNom : 2023-03-24_10h37_37.png
Affichages : 148
Taille : 40,0 Ko


Merci beaucoup pour votre aide