Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Applet to Servlet Https communication

Posted on 2009-07-08
2
Medium Priority
?
638 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 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