Sun GlassFish Enterprise Server v2.1.1 High Availability Administration Guide

ProcedureTo Export and Import the DAS Certificate for Sun Web Server 7

  1. If you are using Enterprise Server with HADB bundle, export the DAS certificate by executing the command:

    <as home>/lib/upgrade/pk12util -d <domain root>/config -o sjsa.p12 -W
    <file password> -K <master password> -n s1as
    • If you are using GlassFish v2.1 or Enterprise Server without HADB bundle, export the DAS certificate, named with the alias “s1as” using the Java SE 5.0 security tool called keytool. While doing so, select the -rfc option to export the certificate in the printable encoding format, as defined by the Internet RFC 1421 standard.

      From the command line, you can use the following commands to export the DAS certificate:

      <JAVA_HOME>/bin/keytool -export -rfc -alias s1as -keystore
      <GLASSFISH_HOME>/domains/<DOMAIN_NAME>/config/keystore.jks-file s1as.rfc

      where, <GLASSFISH_HOME> indicates the Application Server installation directory and <DOMAIN_NAME> refers to the domain whose certificate is being exported.

    • Copy the certificate file to the web server configuration directory.

  2. If you are using Enterprise Server with HADB bundle, import the DAS certificate into the Web Server instance using the following commands:

    <webserver home>/bin/https/admin/bin/pk12util-i sjsas.p12 -d <webserver
    home>/alias -W<file password> -K <webserver security db password> -P
    <instance-name>-<hostname>-
    <webserver home>/bin/https/admin/bin/certutil -M -n s1as -t "TCu,Cu,Tuw"
    -d alias -P <instance-name>-<hostname>-

    This command makes the Application Server CA be a trusted CA to sign both client and server certificates.

    • If you are using GlassFish v2.1 or Enterprise Server without HADB bundle, import the DAS certificate from the rfc file created using certutil, the NSS security tool.

      <webserver_home>/bin/certutil -A -a -n s1as -t "TC" -i s1as.rfc -d
      <WS_INSTALL_ROOT>/admin-server/config-store/<CONFIG_NAME>/config

      where, <webserver_home> refers to the web server installation directory and <CONFIG_NAME> refers to the configuration name created for the default web server instance.

      You can check the presence of this certificate by using the following command, which would list the s1as certificate along with other CA certificates including the default server certificate. Make sure that you type the entire command in a single line.

      <WS_INSTALL_ROOT>/bin/certutil -L -d
      <WS_INSTALL_ROOT>/admin-server/config-store/
      <DEFAULT_CONFIG_NAME>/config

      You can also use the Web Server Admin Console to view this. Select the configuration to which the certificate has been imported to (default config, in this case), and then select the Certificates tab. To look at all the certificates available, select the Certificate Authorities sub tab.

  3. Make the following configuration changes to Web Server 7.0.

    1. Append the following lines to obj.conffile located at <WS_INSTALL_ROOT>/admin-server/config-store/<DEFAULT_CONFIG_NAME>/config/:

       <Object ppath="*lbconfigupdate*">
       PathCheck fn="get-client-cert" dorequest="1" require="1"
      </Object>
      <Object ppath="*lbgetmonitordata*">
       PathCheck fn="get-client-cert" dorequest="1" require="1"
      </Object>
  4. Deploy the configuration. While doing the changes listed in the previous steps, the Admin Console would mark this configuration to be deployed.

    1. Select the icon for Deployment Pending in the Web Server Admin Console. You can also deploy this configuration using the CLI utility wadm as follows:

      <WS_INSTALL_ROOT>/bin/wadm deploy-config-user=<admin><DEFAULT_CONFIG_NAME>

      where <admin> is the administator user name.

  5. Test this setup from the GlassFish DAS to see if it communicates with the configured HTTP Load Balancer over SSL. For more information, see Verifying the Setup.