Tyler Muth’s Blog

Technology with a focus on Oracle, Application Express and Linux

Oracle Wallet w/ Self-Signed Certificate

Posted by Tyler Muth on July 27, 2007

I was working with some of the security tools included with the Oracle Advanced Security Option and wanted to create a new wallet without going through the hassle of requesting a certificate from one of the popular certificate authorities. After struggling a bit with creating a self-signed certificate, I found a great HowTo by Jim Coulter entitled “How To Build an Oracle Wallet with OpenSSL”. Since I’m planning on a number of future security posts that rely on the Oracle Wallet Manager, I wanted to repost Jim’s HowTo here so they would all be at the same location. Just to be clear, this is NOT my HowTo, it’s Jim’s and I want to give him full credit for a very concise and accurate HowTo.

This HowTo is relevant for any Oracle component that uses the Oracle Wallet Manager, including the Oracle Database with the Advanced Security Option (ASO), Oracle Application Server, Oracle HTTP Server (OHS), Oracle Internet Directory (ODI). For production environments, you should purchase a certificate from a well known certificate authority such as Entrust, Thawte, GoDaddy, or VeriSign. Using self-signed certificates provides no protection against man in the middle attacks so they should NOT be used in production environments.

Even though the example is Linux / Unix centric, I also tested this on Windows using CygWin and it worked flawlessly.

From Jim Coulter’s site, with one addition:

  1. Download and unpack the ssl helper scripts named ssl.ca-0.1.tar.gz from the OpenSSL > Contributions page.
  2. Open Oracle Wallet Manager and create a new wallet and certificate request.
  3. Export the certificate request to a file. Give it a .csr extension
  4. Move the certificate request to the directory containing the openSSL certificate authority scripts (e.g. /usr/src/crytpo/openssl/apps/ssl.ca-0.1)
  5. Create a self-signed root certificate by running the new-root-ca.sh script. This will create a file called ca.crt
  6. Create the self-signed server certificate by running the sign-server-cert.sh script, e.g. # sign-server-cert.sh <certificate-request-filename>. This will create a file called <certificate-request-filename>.crt
  7. Import the ca.crt into the Oracle wallet as a trusted certificate. Import the <certificate-request-filename>.crt as a user certificate.
  8. Enable auto-login and save the wallet. It is now ready for use.

References:

11 Responses to “Oracle Wallet w/ Self-Signed Certificate”

  1. D.Schroff Says:

    Hi,
    thanks for this nice howto! In the official Oracle documentation this is completey missing.

    regards
    Dietrich

  2. CL Says:

    i’m stuck at step 7. trying to import my user.crt i get the following error:

    User certificate installation failed.
    Possible errors:
    - Input was not a valid certificate
    - No matching certificate request was found
    - CA certificate needed for certificate chain not found. Please install it first.

    all the other steps were done quickly wíthout problems. any ideas?
    cornelius

  3. Harvey Raja Says:

    Cornelius,

    Try pasting only the Base64′d part of the user certificate.

    - Harvey

  4. CL Says:

    thanks, that worked :) cornelius

  5. Paul Knibbs Says:

    Hi CL (et.al.)

    What constitutes the Base64′d part of the certificate? Is it that part which lies between the —–BEGIN CERTIFICATE—– and —–END CERTIFICATE—– tags?

    Cheers,
    Paul

  6. BigKahuna Says:

    Paul - yes that’s correct. Cut and past the stuff between the BEGIN CERTIFICATE and END CERTIFICATE tags..

  7. Kannan Says:

    Tyler

    Your post was very useful along with other posts that I referred. I’ve compiled a page for those who would want to look at how to configure a “Self-Signed Certificate for Oracle Application Express with Oracle AS 10.1.2 on Windows 2003″. It can be found at http://kannankumara.blogspot.com/2008/02/self-signed-certificate-for-oracle-as.html

  8. SB Says:

    Tyler,

    We do have open SSL installed. I have tried this logged on as both root and as oracle. And recieved the following error both times:

    /export/home/oracle/SCRIPTS/OPEN_SSL/ssl.ca-0.1
    # /export/home/oracle/SCRIPTS/OPEN_SSL/ssl.ca-0.1/new-root-ca.sh
    No Root CA key round. Generating one
    /export/home/oracle/SCRIPTS/OPEN_SSL/ssl.ca-0.1/new-root-ca.sh: openssl: not found

    Self-sign the root CA…
    /export/home/oracle/SCRIPTS/OPEN_SSL/ssl.ca-0.1/new-root-ca.sh: openssl: not found

  9. Moosa Says:

    Hi All,
    I am also getting the same error
    User certificate Installation failed..
    Possible errors

    Input was not a valid certificate
    No matching certificate reques was found
    CA certificate needed for certificate chain not found.Please install it first

    I have even tried to paste Base64′d part, but still the same error. Any suggestions would be appreciated.

    Thanks,
    Moosa.

  10. Frank Says:

    What about orapki? To generate a self signed wallet, just do:
    cd to your wallet directory
    orapki wallet create -wallet ./ -auto_login
    orapki wallet add -wallet ./ -dn “cn=,cn=OracleContext,dc=oracle,dc=com” -keysize 1024 -self_signed -validity 3650
    ..done!

  11. mac Says:

    Hi,

    Im also having the same error

    even if i just copied the base 64

    Input was not a valid certificate
    No matching certificate reques was found
    CA certificate needed for certificate chain not found.Please install it first

    Please help.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>