Replies: 2 comments 7 replies
-
See oracle/python-cx_Oracle#570 - in particular oracle/python-cx_Oracle#485 (comment) @anthony-tuininga was looking at this area recently again but the above is the current best practice. Or convert to 1-way TLS, which will make your apps faster we're told. |
Beta Was this translation helpful? Give feedback.
6 replies
-
Well, I have to eat crow here.
Who knows what was going on with the old one... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to connect to an ADW instance (19c) using a mTLS wallet and the listener is rejecting the connection.
I am using the same wallet (in the same directory) to successfully connect the ORA SQL Developer plug-in for VSCode to the PDB/schema I need.
I have to use the mTLS wallet since the ADW instance is on a "always free" instance which doesn't allow the use of TLS option
Env:
staging_high = (description= (retry_count=20)(retry_delay=3)
(address=(protocol=tcps)(port=1522)(host=adb.ca-toronto-1.oraclecloud.com))
(connect_data=(service_name=a1b2c3d4e5f6g7h_staging_high.adb.oraclecloud.com))
(security=(ssl_server_dn_match=yes))
)
~~ Current Code ~~
import oracledb
uname = "UID"
pwd = "user pwd"
svc = "staging_high"
cdir = "/[project dir path]/config/rdb/wallet_extract/" //unzipped contents of adb_wallet.zip (see Scenarios below)
wltloc = cdir
wltpwd = "wlt pwd"
try:
connection = oracledb.connect(
user=uname,
password=pwd,
protocol="tcps",
host="adb.ca-toronto-1.oraclecloud.com",
port=1522,
dsn=svc,
config_dir=cdir,
wallet_location=wltloc,
wallet_password=wltpwd
)
print("Successfully connected to Oracle Database")
except Exception as err:
print(f"Connection Failed: {err}")
Scenario 1:
cdir = "/[project dir path]/config/rdb/adb_wallet.zip"
wltloc = cdir
Error Message: Connection Failed: DPY-4026: file tnsnames.ora not found in /[project dir path]/config/rdb/adb_wallet.zip
Scenario 2:
cdir = "/[project dir path]/config/rdb/wallet_extract/"
wltloc = "/[project dir path]/config/rdb/adb_wallet.zip"
Error Message: Connection Failed: DPY-6005: cannot connect to database (CONNECTION_ID=I0M6akz10QcwsfW4JhQ7SQ==).
DPY-2018: wallet file /[project dir path]/config/rdb/adb_wallet.zip/ewallet.pem was not found
Scenario 3 (the code at the begining of the post) :
cdir = "/[project dir path]/config/rdb/wallet_extract/"
wltloc = cdir
Error Message: Connection Failed: DPY-6005: cannot connect to database (CONNECTION_ID=asV5uLI0b6615dhitv6fEw==).
DPY-6000: Listener refused connection. (Similar to ORA-12506)
It does not look like python-oracledb has the ability to look into the zipped wallet.
Having to extract the contents to make things work is bit of a security fail.
Can you suggest any other strategies/configurations that I can use to get this connection work?
Beta Was this translation helpful? Give feedback.
All reactions