프린트 하기

OS 환경 : Oracle Linux 8.4 (64bit)

 

DB 환경 : Oracle Database 19.28.0.0 RAC

 

방법 : 오라클 19c RAC 환경 ssl(tls)을 이용한 tns(tcps) 연결 설정

싱글 db에서 ssl(tls)을 이용한 tns 설정은 이전 게시물을 참고하면됨
참고 : 오라클 19c 환경 ssl(tls)을 이용한 tns(tcps) 연결 설정 ( https://positivemh.tistory.com/1305 )

 

 

Oracle Database에서는 기본적으로 TCP 기반으로 클라이언트와 서버가 통신함
이 방식은 내부망에서는 문제가 없지만, 외부망 연동이나 보안 요구 수준이 높은 환경에서는 패킷 스니핑이나 중간자 공격 가능성이 존재함
이를 해결하기 위해 Oracle은 SSL/TLS를 이용한 TCPS 프로토콜을 제공하며, 네트워크 구간 전체를 암호화해 안전한 연결을 보장함
19c 버전에서도 표준 기반 TLS를 사용해 서버 인증, 암호화, 무결성을 확보할 수 있음
본문에서는 Oracle 19c 2node RAC db에서 SSL/TLS 기반 TCPS 연결을 구성하는 방법을 설명함

 

 

SSL/TLS 이란?
SSL/TLS는 인터넷에서 가장 널리 사용되는 보안 프로토콜이고 전송되는 데이터를 암호화해 제3자가 내용을 볼 수 없도록 보호하는 기술임
Oracle Database의 TCPS 프로토콜은 이러한 SSL/TLS 위에서 동작함
서버 인증과 데이터 암호화를 통해 안전한 네트워크 연결을 제공함
SSL은 원래 1990년대에 개발된 프로토콜이고 현대에는 더 강화된 버전인 TLS가 표준으로 사용됨
Oracle 19c는 기본적으로 TLS 1.2를 사용함, 서버 인증서 기반 검증과 암호화된 세션 생성 방식을 따름

 

 

핸드셰이크란?
핸드셰이크는 클라이언트와 서버가 TLS 연결을 시작할 때 수행하는 초기 협상 과정임
이 과정에서 암호화 방식, 서버 인증서 검증, 세션키 생성 등의 절차가 이루어지며
핸드셰이크가 성공해야 이후의 암호화된 데이터 통신이 시작됨

 

 

TCPS(SSL/TLS) 기반 Oracle Net 통신의 동작 방식
1. 서버 인증서 제시 및 클라이언트 검증
클라이언트는 서버가 제공한 인증서가 신뢰할 수 있는 CA로 서명되었는지 확인하고
DN(CN) 값이 접속하려는 서버와 일치하는지 검증하여 서버의 신뢰성을 확보함

 

2. TLS 핸드셰이크 기반 세션키 생성
초기 메시지는 서버의 공개키를 활용하는 비대칭 암호 기반으로 교환되며
이후에는 성능이 우수한 대칭키 기반 세션키로 암호화 통신을 수행함

 

3. Oracle Net 패킷 암호화 전송
SQL 요청, 결과 Fetch 등 모든 트래픽이 암호화되어 네트워크 스니핑이나 중간자 공격을 방지함

 

4. 단방향 TLS 및 mTLS 인증 방식 선택
단방향 TLS는 서버 인증서만 사용하여 서버 진위만 확인하며 mTLS는 클라이언트도 인증서를 제시해 서버가 클라이언트를 인증함
참고로
단방향은 SSL_CLIENT_AUTHENTICATION = FALSE로 설정하고
mTLS 방식은 SSL_CLIENT_AUTHENTICATION = TRUE로 설정함

 

5. TCPS 리스너 기반 TLS 암호화 연결 처리
listener.ora에서 (PROTOCOL=TCPS)를 지정하면 리스너가 해당 포트를 TLS 모드로 리스닝하며
클라이언트는 PROTOCOL=TCPS를 사용해 암호화된 세션을 형성함

 

 

중요사항. RAC의 경우 루트 CA 인증서가 필요함
싱글 db에 셀프 인증서만으로 tls를 설정한것과는 다르게 추가로 루트 CA 인증서가 필요함
Listener 인증서, SCAN Listener 인증서, DB Node 인증서 모두 동일한 Root CA에서 서명되어야함
클라이언트도 Root CA만 trust 등록하면 다중 노드를 신뢰할 수 있게됨

 

 

테스트 서버 정보
db 서버 vip : 192.168.137.61, 192.168.137.62
클라이언트 서버 : 192.168.137.50

 

 

테스트
1. 서버 Wallet 생성 및 인증서 준비
2. 클라이언트 Wallet 생성 및 인증서 준비
3. 클라이언트 network 파일 수정
4. 서버 network 파일 수정
5. 테스트 연결

 

 

테스트
1. 서버 Wallet 생성 및 인증서 준비
로컬 Root CA Wallet 생성(auto-login 포함)(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
$ mkdir -p /oracle/app/oracle/wallets/ca
$ chmod 700 /oracle/app/oracle/wallets/ca
$ orapki wallet create \
  -wallet /oracle/app/oracle/wallets/ca \
  -pwd "dnjffpt123!" \
  -auto_login
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

Root CA 인증서 생성(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/ca \
  -dn "CN=TEST-ROOT-CA, OU=DB, O=Test, C=KR" \
  -keysize 2048 \
  -self_signed \
  -validity 3650 \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

Root CA 인증서 export(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
$ orapki wallet export \
  -wallet /oracle/app/oracle/wallets/ca \
  -dn "CN=TEST-ROOT-CA, OU=DB, O=Test, C=KR" \
  -cert /tmp/test-root-ca.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

export 한 파일 확인(1번 노드에서 수행)

1
2
$ ls -al /tmp/test-root-ca.cer
-rw-------. 1 oracle oinstall 1106 Feb 23 21:21 /tmp/test-root-ca.cer

 

 

Wallet 생성 + CSR(Certificate Signing Request(인증서 서명 요청)) 생성(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ mkdir -p /oracle/app/oracle/wallets/db_node1
$ chmod 700 /oracle/app/oracle/wallets/db_node1
$ orapki wallet create \
  -wallet /oracle/app/oracle/wallets/db_node1 \
  -pwd "dnjffpt123!" \
  -auto_login
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node1 \
  -dn "CN=192.168.137.61, OU=DB, O=Test, C=KR" \
  -keysize 2048 \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet export \
  -wallet /oracle/app/oracle/wallets/db_node1 \
  -dn "CN=192.168.137.61, OU=DB, O=Test, C=KR" \
  -request /tmp/node1.csr \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

CA로 CSR 서명 -> node1 서버 인증서 발급(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
$ orapki cert create \
  -wallet /oracle/app/oracle/wallets/ca \
  -request /tmp/node1.csr \
  -cert /tmp/node1-server.cer \
  -serial_num 1001 \
  -validity 3650 \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

node1 서버 Wallet에 CA cert + 서버 cert import(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node1 \
  -trusted_cert \
  -cert /tmp/test-root-ca.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node1 \
  -user_cert \
  -cert /tmp/node1-server.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

2번노드에서 ca 인증서용 경로 생성(2번 노드에서 수행)

1
$ mkdir -p /oracle/app/oracle/wallets/ca

 

 

1번노드 ca 인증서 경로 2번노드로 복제(1번 노드에서 수행)

1
2
3
4
5
6
$ cd /oracle/app/oracle/wallets/ca
$ scp ./* 192.168.137.62:/oracle/app/oracle/wallets/ca/
cwallet.sso                               100% 4107     2.1MB/s   00:00
cwallet.sso.lck                           100%    0     0.0KB/s   00:00
ewallet.p12                               100% 4062     4.0MB/s   00:00
ewallet.p12.lck                           100%    0     0.0KB/s   00:00

 

 

Root CA 인증서 2번노드로 복제(1번 노드에서 수행)

1
2
3
$ cd /tmp
$ scp test-root-ca.cer 192.168.137.62:/tmp/
test-root-ca.cer                          100% 1106     1.6MB/s   00:00

 

 

Wallet 생성 + CSR(Certificate Signing Request(인증서 서명 요청)) 생성(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ mkdir -p /oracle/app/oracle/wallets/db_node2
$ chmod 700 /oracle/app/oracle/wallets/db_node2
$ orapki wallet create \
  -wallet /oracle/app/oracle/wallets/db_node2 \
  -pwd "dnjffpt123!" \
  -auto_login
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node2 \
  -dn "CN=192.168.137.62, OU=DB, O=Test, C=KR" \
  -keysize 2048 \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet export \
  -wallet /oracle/app/oracle/wallets/db_node2 \
  -dn "CN=192.168.137.62, OU=DB, O=Test, C=KR" \
  -request /tmp/node2.csr \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

CA로 CSR 서명 -> node2 서버 인증서 발급(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
$ orapki cert create \
  -wallet /oracle/app/oracle/wallets/ca \
  -request /tmp/node2.csr \
  -cert /tmp/node2-server.cer \
  -serial_num 1001 \
  -validity 3650 \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

node2 서버 Wallet에 CA cert + 서버 cert import(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node2 \
  -trusted_cert \
  -cert /tmp/test-root-ca.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.
 
$ orapki wallet add \
  -wallet /oracle/app/oracle/wallets/db_node2 \
  -user_cert \
  -cert /tmp/node2-server.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

인증서 확인(1번 노드에서 확인)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ orapki wallet display -wallet /oracle/app/oracle/wallets/ca/
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Requested Certificates:
User Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR
Trusted Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR
 
$ orapki wallet display -wallet /oracle/app/oracle/wallets/db_node1/
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Requested Certificates:
User Certificates:
Subject:        CN=192.168.137.61,OU=DB,O=Test,C=KR
Trusted Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR

 

 

인증서 확인(2번 노드에서 확인)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ orapki wallet display -wallet /oracle/app/oracle/wallets/ca/
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Requested Certificates:
User Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR
Trusted Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR
 
$ orapki wallet display -wallet /oracle/app/oracle/wallets/db_node2/
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Requested Certificates:
User Certificates:
Subject:        CN=192.168.137.62,OU=DB,O=Test,C=KR
Trusted Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR

 

 

참고용. 월렛 삭제 명령

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#User Certificate 삭제
$ orapki wallet remove \
  -wallet /oracle/app/oracle/wallets/ca \
  -user_cert \
  -dn "CN=192.168.137.61,OU=DB,O=Test,C=KR" \
  -pwd "dnjffpt123!"
  
#Trusted Certificate 삭제
$ orapki wallet remove \
  -wallet /oracle/app/oracle/wallets/ca \
  -trusted_cert \
  -dn "CN=192.168.137.61,OU=DB,O=Test,C=KR" \
  -pwd "dnjffpt123!"
 
#월렛 경로 자체 삭제(모두 삭제)
$ rm -rf /oracle/app/oracle/wallets/*

 

 

2. 클라이언트 Wallet 생성 및 인증서 준비
서버 인증서를 CA가 서명한 경우 클라이언트 OS가 해당 CA 루트/중간 인증서를 이미 신뢰한다면 "walletless TLS" 구성이 가능하고, 별도의 client wallet 없이도 TLS 접속이 가능하다고함
본문에서는 클라이언트도 Oracle Wallet을 사용하는 방식으로 진행함

 

 

Root CA 인증서 클라이언트 서버로 전송(1번 노드에서 수행)

1
2
3
$ cd /tmp
$ scp test-root-ca.cer 192.168.137.50:/tmp/
test-root-ca.cer                          100% 1106     1.6MB/s   00:00

 

 

클라이언트 wallet용 경로 생성(클라이언트 서버에서 수행)

1
2
$ mkdir -p /app/oracle/wallets/client
$ chmod 700 /app/oracle/wallets/client

 

 

클라이언트 Wallet 생성 (auto-login 포함)(클라이언트 서버에서 수행)

1
2
3
4
5
6
7
8
9
$ orapki wallet create \
  -wallet /app/oracle/wallets/client \
  -pwd "dnjffpt123!" \
  -auto_login
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

client wallet에 trust 추가(클라이언트 서버에서 수행)

1
2
3
4
5
6
7
8
9
10
$ orapki wallet add \
  -wallet /app/oracle/wallets/client \
  -trusted_cert \
  -cert /tmp/test-root-ca.cer \
  -pwd "dnjffpt123!"
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Operation is successfully completed.

 

 

인증서 확인(클라이언트 서버에서 수행)

1
2
3
4
5
6
7
8
9
$ orapki wallet display -wallet /app/oracle/wallets/client
Oracle PKI Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
 
Requested Certificates:
User Certificates:
Trusted Certificates:
Subject:        CN=TEST-ROOT-CA,OU=DB,O=Test,C=KR

 

 

3. 클라이언트 network 파일 수정
sqlnet.ora 파일 수정(클라이언트 서버에서 수행)

1
2
3
4
5
6
7
8
9
$ vi $ORACLE_HOME/network/admin/sqlnet.ora
#추가
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /app/oracle/wallets/client)
    )
  )

 

 

tnsnames.ora 파일 수정(클라이언트 서버에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$ vi $ORACLE_HOME/network/admin/tnsnames.ora
#추가
ORA19RAC_VIP1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.61)(PORT = 2484))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA19DB)
    )
  )
 
ORA19RAC_VIP2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.62)(PORT = 2484))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA19DB)
    )
  )
 
ORA19RAC_ALL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.61)(PORT = 2484))
      (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.62)(PORT = 2484))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA19DB)
    )
  )

 

 

4. 서버 network 파일 수정
기존 리스너 확인(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
$ srvctl config listener
Name: LISTENER
Type: Database Listener
Network: 1, Owner: oracle
Home: <CRS home>
End points: TCP:1521
Listener is enabled.
Listener is individually enabled on nodes:
Listener is individually disabled on nodes:

 

 

리스너에 tcps 추가 및 확인(아무 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
$ srvctl stop listener
$ srvctl modify listener -p TCP:1521/TCPS:2484
$ srvctl start listener
$ srvctl config listener
Name: LISTENER
Type: Database Listener
Network: 1, Owner: oracle
Home: <CRS home>
End points: TCP:1521/TCPS:2484
Listener is enabled.
Listener is individually enabled on nodes:
Listener is individually disabled on nodes:

 

 

GRID_HOME sqlnet.ora 파일 수정(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
$ vi $GRID_HOME/network/admin/sqlnet.ora
#추가
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node1)
    )
  )

 

 

ORACLE_HOME sqlnet.ora 파일 수정(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
$ vi $ORACLE_HOME/network/admin/sqlnet.ora
#추가
SQLNET.AUTHENTICATION_SERVICES = (BEQ, TCP, TCPS)
 
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node1)
    )
  )

 

 

GRID_HOME listener.ora 파일 수정(1번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
$ vi $GRID_HOME/network/admin/listener.ora
#추가
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node1)
    )
  )

 

 

GRID_HOME sqlnet.ora 파일 수정(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
$ vi $GRID_HOME/network/admin/sqlnet.ora
#추가
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node2)
    )
  )

 

 

ORACLE_HOME sqlnet.ora 파일 수정(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
12
13
$ vi $ORACLE_HOME/network/admin/sqlnet.ora
#추가
SQLNET.AUTHENTICATION_SERVICES = (BEQ, TCP, TCPS)
 
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node2)
    )
  )

 

 

GRID_HOME listener.ora 파일 수정(2번 노드에서 수행)

1
2
3
4
5
6
7
8
9
10
11
$ vi $GRID_HOME/network/admin/listener.ora
#추가
SSL_CLIENT_AUTHENTICATION = FALSE
 
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = /oracle/app/oracle/wallets/db_node2)
    )
  )

 

 

local_listener 파라미터 확인(1번 노드에서 수행)

1
2
3
4
5
6
7
8
SQL> show parameter local_listener
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                                 192.168.137.61)(PORT=1521)), (
                                                 ADDRESS=(PROTOCOL=TCPS)(HOST=1
                                                 92.168.137.61)(PORT=2484))

 

 

local_listener 파라미터 확인(2번 노드에서 수행)

1
2
3
4
5
6
7
8
SQL> show parameter local_listener
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                                 192.168.137.62)(PORT=1521)), (
                                                 ADDRESS=(PROTOCOL=TCPS)(HOST=1
                                                 92.168.137.62)(PORT=2484))

 

 

리스너 및 db 재기동(아무 노드에서 수행)

1
2
3
4
$ srvctl stop listener
$ srvctl start listener
$ srvctl stop database -d ORA19DB
$ srvctl start database -d ORA19DB

 

 

리스너 상태 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$ lsnrctl status
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-FEB-2026 21:43:43
 
Copyright (c) 1991, 2025, Oracle.  All rights reserved.
 
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                23-FEB-2026 21:41:44
Uptime                    0 days 0 hr. 1 min. 58 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid/19c/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/ora19rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=192.168.137.61)(PORT=2484)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.137.161)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.137.61)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_OCRVOTE" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_RECO" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "ORA19DB" has 1 instance(s).
  Instance "ORA19DB1", status READY, has 1 handler(s) for this service...
Service "ORA19DBXDB" has 1 instance(s).
  Instance "ORA19DB1", status READY, has 1 handler(s) for this service...
The command completed successfully

 

 

5. 테스트 연결
클라이언트 -> 서버 연결 테스트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ sqlplus system/oracle@ORA19RAC_VIP1
 
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 23 21:58:51 2026
Version 19.27.0.0.0
 
Copyright (c) 1982, 2025, Oracle.  All rights reserved.
 
Last Successful login time: Mon Feb 23 2026 21:51:40 +09:00
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0
 
SQL> select instance_name, status, version from v$instance;
 
INSTANCE_NAME    STATUS       VERSION
---------------- ------------ -----------------
ORA19DB1         OPEN         19.0.0.0.0

잘 붙음

 

 

연결 정보 확인

1
2
3
4
5
6
7
SQL> 
col protocol for a10
select sys_context('userenv','network_protocol') as protocol from dual;
 
PROTOCOL
---------
tcps

tcps로 붙음

 

 

참고1. 일반 방식으로 접속 후 확인하면 프로토콜이 tcp로 표시됨
일반 방식으로 접속 후 연결 정보 확인

1
2
3
4
5
6
7
SQL> 
col protocol for a10
select sys_context('userenv','network_protocol') as protocol from dual;
 
PROTOCOL
---------
tcp

tcp로 붙음

 

 

참고2. tcp방식과 tcps 방식 tnsping 속도 비교
tnsnames.ora에 두가지 모두 등록

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ cat $ORACLE_HOME/network/admin/tnsnames.ora
ORA19DB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.61)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA19DB)
    )
  )
 
ORA19RAC_VIP1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.61)(PORT = 2484))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA19DB)
    )
  )

 

 

tnsping 확인
tcp 방식 tnsping

1
2
3
4
5
6
7
8
9
10
11
12
13
$ tnsping ORA19DB1
 
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 23-FEB-2026 22:01:29
 
Copyright (c) 1997, 2025, Oracle.  All rights reserved.
 
Used parameter files:
/oracle/app/oracle/product/19c/network/admin/sqlnet.ora
 
 
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.61)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORA19DB)))
OK (0 msec)

 

 

tcps 방식 tnsping

1
2
3
4
5
6
7
8
9
10
11
12
13
$ tnsping ORA19RAC_VIP1
 
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 23-FEB-2026 22:01:33
 
Copyright (c) 1997, 2025, Oracle.  All rights reserved.
 
Used parameter files:
/oracle/app/oracle/product/19c/network/admin/sqlnet.ora
 
 
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.137.61)(PORT = 2484)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORA19DB)))
OK (50 msec)

여러번 수행했지만 tcps 방식이 매번 50 msec씩 소요됨, tcp 방식은 0 msec 소요됨
TLS 핸드셰이크(Handshake) 단계가 추가되서 조금 더 느린듯 함

 

 

참고3. 본문 방식으로 tls 적용시 리스너 로그에 TNS-00542, TNS-12560가 주기적으로 찍힘
정확한 원인은 찾지 못했음

1
2
3
4
5
6
7
8
9
10
11
$ tail -300f /oracle/app/oracle/diag/tnslsnr/ora19rac1/listener/trace/listener.log
2026-02-23T22:03:32.594124+09:00
23-FEB-2026 22:03:32 * service_update * ORA19DB1 * 0
23-FEB-2026 22:03:32 * service_update * ORA19DB1 * 0
2026-02-23T22:03:44.283675+09:00
23-FEB-2026 22:03:44 * service_update * +ASM1 * 0
23-FEB-2026 22:03:44 * (ADDRESS=(PROTOCOL=tcps)(HOST=192.168.137.161)(PORT=15552)) * <unknown connect data> * 542
TNS-00542: SSL Handshake failed
 TNS-12560: TNS:protocol adapter error
2026-02-23T22:03:46.109509+09:00
23-FEB-2026 22:03:46 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=ora19rac1)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=318767104)) * status * 0

 

 

결론 :
오라클에서는 기본적으로 TCP 기반으로 통신하지만 외부망 연동이나 보안 요건이 높은 환경에서는 TLS 기반 TCPS 구성을 고려할 수 있음
19c에서는 TLS 1.2를 지원하여 Wallet 기반 인증서 등록을 통해 안전한 암호화 채널을 구축할 수 있음
본문에서는 CA 인증서를 이용해 RAC 환경에서 TCPS 연결을 구성하였지만 single 환경은 Self-signed 방식 인증서를 이용해도됨
싱글의 경우 절차도 나름 간편했고 db 재기동이 필요없었지만 RAC는 절차도 조금 더 복잡하고 db 재기동까지 필요했음
TCPS 연결 구성을 해놓은 상태에서 wallet 삭제 또는 설정 오류 시 TCPS 연결이 안될수 있음
TCPS 연결은 handshake 과정으로 인해 약간의 지연(테스트 결과 tnsping 기준 50ms 수준)이 발생함
자주 연결을 맺고 끊는 AP 환경이라면 handshake 과정으로 인해 지연을 느낄수도 있을듯하지만 WAS 같이 커넥션을 계속 맺어놓고 재사용하는 경우라면 크게 지연을 못느끼지 않을까 싶음(확실하게는 느려지는지는 테스트를 해봐야 알수 있을듯함)

 

 

참조 : 

https://positivemh.tistory.com/1305

https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-secure-sockets-layer-authentication.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-secure-sockets-layer-authentication.html#GUID-9EB5CE4D-AEDD-438F-A08B-60F7FC276BA0
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-secure-sockets-layer-authentication.html#GUID-32A5647F-D07E-470F-99DC-7113BC08F11B
https://oracle-base.com/articles/misc/configure-tcpip-with-ssl-and-tls-for-database-connections
https://royce-fu.com/blog/oracle-database-ssl-tls-1.2-client-server/

https://forums.oracle.com/ords/apexds/post/how-do-i-configure-ssl-for-rac-installation-1408
https://www.alex-sanz.com/2025/12/15/tls-for-oracle-real-application-cluster-rac/
https://gavinsoorma.com.au/knowledge-base/how-to-configure-tls-tcps-for-the-oracle-database/
Step by Step Guide: How to Configure SSL/TLS on ORACLE RAC (with SCAN)(KB325499)
Using Orapki as Certificate Authority(KB511722)