requete https

requete https - Java - Programmation

Marsh Posté le 13-05-2009 à 15:27:15    

Bonjour à tous,
 
J'essaie d'envoyer une requete https (et de traiter la réponse) en utilisant ce bout de code :
 

Code :
  1. String httpsURL = "https://blabla";
  2.     URL myurl = new URL(httpsURL);
  3.     HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
  4.     InputStream ins = con.getInputStream();
  5.     InputStreamReader isr=new InputStreamReader(ins);
  6.     BufferedReader in =new BufferedReader(isr);
  7.     String inputLine;
  8.     while ((inputLine = in.readLine()) != null)
  9.         out.println(inputLine);
  10.     in.close();


 
Sauf que j'ai une erreur me disant que je n'ai pas les certificats correspondants... du genre :  

Code :
  1. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


 
De quoi ai-je besoin pour régler ce problème ?
 

Reply

Marsh Posté le 13-05-2009 à 15:27:15   

Reply

Marsh Posté le 13-05-2009 à 15:34:50    

cannelline a écrit :

De quoi ai-je besoin pour régler ce problème ?


Google.


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 13-05-2009 à 15:49:59    

rha super  :kaola:  
 
bon je reformule ma question...
 
j'ai fait des recherches google avant de poser ma question (si si).
Et il reste une chose pas très claire : ai-je besoin d'ajouter des fichiers .pk** à mon client (fournis par celui qui a mis en place le serveur) ou juste invoquer une bibliothèque java ?
 
du style :  

Code :
  1. System.setProperty("java.protocol.handler.pkgs",
  2.         "com.sun.net.ssl.internal.www.protocol" );
  3.    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());


 
Sauf que moi j'ai pas le JSSE donc il connait pas "Security"

Reply

Marsh Posté le 14-05-2009 à 14:56:16    

tu devrais trouver ton bonheur là dedans : http://www.developpez.net/forums/d [...] via-proxy/

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed