How to use ssl for webservices

Posted on 2004-11-24
Last Modified: 2012-05-05
Please tell step by step. I already have my webservices running in jboss (w/o ssl)
Question by:kumvjuec
    LVL 9

    Expert Comment

    LVL 3

    Author Comment

    Can you please tell me the steps. I already have a webservices project that runs without ssl.
    LVL 6

    Expert Comment

    the free Quick Documentation that can be downloaded from has instructions on how to use SSL with JBoss / Tomcat on pp. 153-156.
    LVL 6

    Accepted Solution

    Using SSL with JBoss
    Author:Tom Coleman <>

    Adding SSL (Secure Socket Layer) support is simple using JBoss 2.4 with either Tomcat or Jetty Web containers. The specific releases used were JBoss 2.4 BETA Rel_2_4_0_23 with Tomcat 3.2.2, and JBoss-2.4.0_Jetty-3.1.RC8-1.

    The target system was a RH Linux 6.2 system using the Sun 1.3 JDK and Sun's Secure Socket Extension, JSSE 1.0.2.

    Outstanding Deployment Issues
    Multiple site certificates. Support of certificates for multiple sites is currently under discussion. Please post your requirements to the forums or the jboss-user mailing list.

    Scott Stark

    Installation & Configuration
    Download JSSE

    If you are using JDK 1.3 or 1.2, JSSE is optional. Download it from Sun's JSSE Page. Jump through the hoops as required.

    If you are using JDK 1.4, JSSE is included. But then, JDK 1.4 is another story.

    Install JSSE

    Follow steps 1 through 5 of the JSSE installation instructions.

    If you need to run 'keytool' on your system to create and/or import certificates, copy the JSSE jars to $JAVA_HOME/jre/lib/ext.

    Generate a Server Key and Certificate

    The following shell script can be used to create a "self-signed" server certificate for testing:

    The keystore file will be generated in the directory from which you run keytool. Copy the keystore file to an appropriate directory.

    keytool -genkey -alias tomcat -keyalg RSA \
       -dname ', OU=Skunk Works Unit, O=Your Organization, L=Your Location, S=Your State, C=US' \
       -keypass changeit \
       -storepass changeit \
       -keystore server.keystore

    It should be possible to import existing certificates generated with OpenSSL using keytool. See the section Importing SSL certificates in the Tomcat documentation.

    Configure Web Container

    If using Tomcat - Find the section in the Tomcat server.xml configuration file that starts with, "Uncomment this for SSL support". Uncomment the following section, and insert the location of your server key.

    <Connector className="org.apache.tomcat.service.PoolTcpConnector">
        <Parameter name="handler"
        <Parameter name="port"
        <Parameter name="socketFactory"
            value="" />
        <Parameter name="keystore" value="/usr/java/jakarta-tomcat-3.2.2/server.keystore" />
        <Parameter name="keypass" value="changeit" />
    Copy the JSSE jars to your $TOMCAT_HOME/lib directory.

    If using Jetty - Find the section in the $JBOSS_JETTY_HOME/conf/jetty/jetty.xml configuration file that starts with, "Uncomment this to add an SSL listener". Uncomment the following section, and insert the location of your server key.

    <Call name="addListener">
        <New class="com.mortbay.HTTP.SunJsseListener">
          <Set name="Port">8443</Set>
          <Set name="MinThreads">5</Set>
          <Set name="MaxThreads">255</Set>
          <Set name="MaxIdleTimeMs">50000</Set>
          <Set name="Keystore"><SystemProperty name="jetty.home" default="."/>/etc/server.keystore</Set>
             <Set name="Password">changeit</Set>
             <Set name="KeyPassword">changeit</Set>
    Start JBoss

    Start JBoss and point your browser to https://your-server-name.your-domain:8443 to test your SSL implementation.

    If using "self-signed" certificates, you may have to import your test certificate into your browser.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Suggested Solutions

    When pages do not download correctly, and you don't know why, the first thing you do is to look at the HTML source code of that page, but not all the downloaded files appear always clearly. If your source includes a javascript that computes the name…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
    The viewer will learn how to count occurrences of each item in an array.

    761 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

    7 Experts available now in Live!

    Get 1:1 Help Now