Using one way TLS in thin mode with python oracledb.connect() function params. #308
-
Hi everyone, I have seen similar questions, but I feel no question coudl answer my specific case. Sorry If I have overlooked a matching quesiton. I am using oracledb in version 2.10 and I try to use one way TLS with it. I have read about one way TLS here but I wondered if one way TLS can be established with using the python function parameters instead of a connection string. I use this context manager of a class "Oracle" to provice a connection to the db:
This works perectly, but from my understanding this provides a not secure tcp protocol connection (please correct me if I am wrong here) If I use the parameter So my questions are:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Can you supply the full traceback that you get instead of just the exception message? That would be helpful. |
Beta Was this translation helpful? Give feedback.
-
I just tried this code: import oracledb
with oracledb.connect(
user="my_user",
password="my_password",
protocol="tcps",
host="my_host",
service_name="my_service_name"
) as conn:
with conn.cursor() as cursor:
cursor.execute(
"select sys_context('userenv', 'service_name') from dual"
)
for row in cursor:
print(row) That works as expected for connecting to a database that supports one-way TLS using the default port of 1521. If you remove the |
Beta Was this translation helpful? Give feedback.
Note as well that the database has to actually support TCPS. If it doesn't on Linux you get this:
[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)
but perhaps on Windows you getNo such file or directory
?