Solved

Applet to Servlet Https communication

Posted on 2009-07-08
2
631 Views
Last Modified: 2013-11-24
Hi Experts,

i have problem to make https communication possible from an applet to a servlet.
At "servletConn.connect();", i got this error: "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

Through http no problem, i used HttpURLConnection and the applet call http://DEV_TEST/pilotproject/servletcontroller, but for Https (which the url is https://DEV_TEST:81/pilotproject/servletcontroller)... oups! The web server is Glassfish 2.1 and the SSL certificate is a Verisign trial cert (14 days).
HttpsURLConnection servletConn = null;
				
servletConn = (HttpsURLConnection) servlet.openConnection();
servletConn.setRequestMethod("POST");
servletConn.setDoInput(true);
servletConn.setDoOutput(true);
servletConn.setUseCaches(false);
servletConn.setDefaultUseCaches(false);
servletConn.setRequestProperty("Content-type", "application/octet-stream");
servletConn.connect();
 
// Envoyer la requête
ObjectOutputStream output = new ObjectOutputStream(servletConn.getOutputStream());
output.writeObject(pack);
output.flush();
output.close();
 
// Attendre et recevoir la réponse
ObjectInputStream input = new ObjectInputStream(servletConn.getInputStream());
pack = (HttpPackage)input.readObject();
input.close();

Open in new window

0
Comment
Question by:pmrenaud
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 375 total points
ID: 24803477
0
 

Author Closing Comment

by:pmrenaud
ID: 31601096
Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question