?
Solved

Applet to Servlet Https communication

Posted on 2009-07-08
2
Medium Priority
?
637 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 1500 total points
ID: 24803477
0
 

Author Closing Comment

by:pmrenaud
ID: 31601096
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
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 step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 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