Solved

Applet to Servlet Https communication

Posted on 2009-07-08
2
629 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB Script to add site to Java Exception List 4 74
Java Options in Zimbra Server 2 50
netstat -ano | find "8000" and taskkill /f /pid 2984 3 55
arguments to jar 5 26
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 learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now