Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Implementing JSSE/SSL in JBoss

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our Project, we are using JBoss 2.2.1 and Tomcat 3.2.1. From this environment we have to access the https port of another Web Server.(iPlanet). We have successfully configured https in iPlanet and is able to access the same from an ordinary Java class. But when the same code snippet is moved to a
bean/servlet in Tomcat& JBoss environment it is failing to
recognise the https protocol. JSSE jar files are in the JBoss classpath.(lib\ext directory).
The error messages we are getting are ..
when the JSSE jars are in JBoss lib\ext
java.net.MalformedURLException: unknown protocol:
https
when the JSSE jars are in <jre> lib\ext
java.net.SocketException: SSL implementation not
available

It will be a great help if you can help us in solving this problem. Any info/ help will be appreciated.

The code snippet related to SSL
----------------------------------------------------
***************

System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("javax.net.ssl.trustStore",
"samplecacerts");
Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());
***********
theUrl = new URL("https://param:9003/";);
HttpsURLConnection con = null;
con = (HttpsURLConnection)theUrl.openConnection();
con.setAllowUserInteraction(true);
con.setUseCaches(false);
con.setRequestProperty("Un_Name","Un_Value");
----------------------------------------------------------------



 
Author
Posts: 6049
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the protocol isn't "registered" with the server. (I don't what what is required to "register" it.) I would also guess that the required libraries (jars) aren't included with your new servers. Check the classpath to be sure.
--Mark
 
Anil C
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
What is puzzling is that we are able to do it from an ordinary class. That is with the jsse jar files in the jre/lib/ext folder. JBoss fails to recognise this -even if we explicitly add this to the JBoss classpath. (java.net.SocketException: SSL implementation not available )
If we move it from jre/lib/ext and put the jars in JBoss/lib/ext ( no need for any classpath entry for this), the error changes to "java.net.MalformedURLException: unknown protocol:https". Ur inference that the problem lies in registering appears to be right. But we are unable to find a reason 'why ?' and how to fix this..
I posted this here in the hope that there will be someone out there who has worked with JBoss and has encountered similar issues and has found the solution...I am sorry if there is a different thread for such implemetation related issues..

[This message has been edited by Anil KC (edited July 11, 2001).]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm transferring this to our new iPlanet forum...
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's how you get this working...
1) in the jboss.properties file of whatever config directory your JBoss server is using, add the following:
#JSSE https URL support
java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
2) download the JSSE package from Sun, and copy the following files over to your $JAVA_HOME/jre/lib/ext directory:
jcert.jar
jnet.jar
jsse.jar
(Apparently the JRE doesn't care that these files are already in JBoss's lib/ext directory.)
3) restart JBoss
Hope this helps!
 
Everybody! Do the Funky Monkey! Like this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic