For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Hi Experts,
Can you please update how to setup SSL in oracle env. I have setup in Both windows and Linux env Oracle SSL configuration.
I Have Created below steps for SSL setup is it correct?
Environment
Oracle DB Hosted on Linux
Replication client hosted on windows.
Steps
## - STEP (1) : Create Server Wallet - (Activities to be performed at Linux Database Server )
Login to the Oracle Server
orapki help
orapki wallet help
mkdir -p $ORACLE_BASE/wallet
export WALLET=$ORACLE_BASE/wallet
echo $WALLET
orapki wallet create -wallet $WALLET -auto_login -pwd PASSWORDHERE
ls -lrt $WALLET
orapki wallet add -wallet $WALLET -pwd PASSWORDHERE -dn "CN=`hostname -s`" -keysize 2048 -self_signed -validity 1825
orapki wallet display -wallet $WALLET -pwd PASSWORDHERE
orapki wallet export -wallet $WALLET -pwd PASSWORDHERE -dn "CN=`hostname -s`" -cert $WALLET/`hostname -s`.cert
cat $WALLET/`hostname -s`.cert
## - STEP (2) : Create Client Wallet & Certificate (Activities to be performed on WINDOWS SERVER)
set WALLET=C:\app\client\wallet
md %WALLET%
dir %WALLET%
Click on START > Type cmd (run as Administrator)
orapki wallet create -wallet %WALLET% -auto_login -pwd PASSWORDHERE
DIR %WALLET%
orapki wallet add -wallet %WALLET% -pwd PASSWORDHERE -dn "CN=******" -keysize 2048 -self_signed -validity 1825
orapki wallet display -wallet %WALLET% -pwd PASSWORDHERE
orapki wallet export -wallet %WALLET% -pwd PASSWORDHERE -dn "CN=*******" -cert %WALLET%\*******.cert
more %WALLET%\*****.cert
## -- STEP (3) : Exchange certificates from vice-versa (Server Cert => Client &&& Client Cert => Server )
SFTP "$WALLET/****.cert" Server Certificate on to WindowsServer "%WALLET%" folder (C:\app\client\wallet)
cd %WALLET%
dir ***.cert
orapki wallet add -wallet %WALLET% -pwd PASSWORDHERE -trusted_cert -cert %WALLET%\******.cert
Note: By now, the above output will result with a new Trusted Server added from Client
SFTP - Windows Client Cert - To the Oracle Database Server
cp -p /tmp/*******.cert $WALLET
orapki wallet add -wallet $WALLET -pwd PASSWORDHERE -trusted_cert -cert $WALLET/******.cert
Note: By now, the above output will result with a new Trusted Server added from Server itself.
## -- STEP (4) : Enable SSL/TLS on Server-Side (Activites to be performed at Linux Database Server )
cd $ORACLE_HOME/network/admin
ls -lrt sqlnet.ora
cp sqlnet.ora sqlnet.ora.bk
cp listener.ora listener.ora.bk
cp tnsnames.ora tnsnames.ora.bk
vi sqlnet.ora
WALLET_LOCATION =
(SOURCE = (METHOD = FILE) (METHOD\_DATA = (DIRECTORY = /u01/app/oracle\_base/wallet) ) )
:wq (Save the Document)
vi listener.ora (add it to the last)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = \*\*\*\*\*) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCPS)(HOST = \*\*\*\*\*) (PORT = 2484)) )
)
(SOURCE =
(METHOD = FILE) (METHOD\_DATA = (DIRECTORY = /u01/app/oracle\_base/wallet) )
lsnrctl stop
lsnrctl status
netstat -tlpn | grep 1521
netstat -tlpn | grep 2484
## -- STEP (5) : Enable SSL/TLS on Client-Side (Windows)
cd C:\app\client\product\12.2.0\client_1\network\admin
copy sqlnet.ora sqlnet.ora.bk
copy listener.ora listener.ora.bk
copy tnsnames.ora tnsnames.ora.bk
(METHOD = FILE) (METHOD\_DATA = (DIRECTORY = C:\\app\\client\\wallet) )
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
SQLNET.AUTHENTICATION_SERVICES = (TCPS,NTS,NONE)
SQLNET.CRYPTO_CHECKSUM_CLIENT=REQUIRED
SQLNET.ENCRYPTION_TYPES_CLIENT=(AES256)
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT=(SHA1)
<< Existing Ones:>>
*****=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=Oracle DB IP)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=****))
<< New Entry Added:>>
****_SSL=
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCPS)(HOST=Oracle DB IP)(PORT=2484)))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=*****))
Note: Save the file
## -- STEP (6) : Open the newly added TCPS/TLS Port on the Linux Database Server
sudo su - oracle
sudo firewall-cmd --state
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --list-all
sudo firewall-cmd --zone=public --add-port=2484/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports
sudo /bin/systemctl restart sshd.service
telnet <Target DB Server> 2484
## -- STEP (7) : Testing the connectivity from the CLient (Windows Server)
Start > Command Prompt (Open with NON-Administrative Rights)
tnsping **** -or- tnsping ****
==> This should resolve !!
tnsping ****_SSL -or- tnsping ****_ssl
==> Even this should also resolve !!
sqlplus scott@*** ==> SUCCESSFUL
sqlplus scott@****_ssl ==> SUCCESSFUL
## -- End of the Document ----------------------------------------------------##