Monday, January 9, 2012

Creating a self-signed certificate using Oracle orapki

In our development environment, when configuring HTTPS for the Oracle XML DB Protocol Server I had to generate a self-signed certificate. All the examples I had seen relied on the owm utility which is only useful in Windows or a X11 environment. To generate a self-signed certificate from the command line execute the following commands:

# Create a new wallet in $ORACLE_BASE/oradata/DEV/wallets/
orapki wallet create -wallet $ORACLE_BASE/oradata/DEV/wallets/ -pwd oracle01 -auto_login

# Add the self-signed certificate to the new wallet
orapki wallet add -wallet $ORACLE_BASE/oradata/DEV/wallets/ -dn "CN=,OU=,O=My Organsisation,L=London,ST=Greater London,C=GB" \
-keysize 1024 -self_signed -validity -pwd oracle01