Replies: 8 comments 7 replies
-
The One way to add certificates for Python is to install the Python 'certifi' package. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply Chris. Yes, this code is TLS, as there's no pem file being passed. I don't really need mTLS, it would be nice to have but not essential. I don't know the proper way to create the PEM file, the documentation isn't clear enough for me to follow, and the Python program didn't work for me - I've have to run it again to check the error. Is there detailed documentation how to create the PEM file suitable for python-oracledb to read it? That's lower priority for me than getting standard TLS working. I've already tried the same with python as Java / SQLDeveloper, which is to add the RDS root certificate to the keystore. I edited the file C:\Users\Tim\AppData\Roaming\Python\Python39\site-packages\certifi\cacert.pem and added the RDS Root CA Cert at the bottom of the file. There were two other cacert.pem files in the C:\Users\Tim\AppData\Roaming\Python\Python39 folder structure so I added it to both others, just in case, and I also put it into the Windows root store. Is this what is required? Or should I do something else? C:\Users\Tim\AppData\Roaming\Python\Python39\site-packages\botocore I would be happy to send a PM with user, password and URL to someone reputable to try out. I would need to whitelist their IP, even though the database and the whole AWS account it's is entirely disposable. |
Beta Was this translation helpful? Give feedback.
-
Tim, thanks for posting the packet output. The fact that you are getting packets at all tells me that the initial TLS negotiation is proceeding without difficulty. We recently became aware of the fact that TLS renegotiation is not being performed in some instances -- and it looks like you might be bitten by that. |
Beta Was this translation helpful? Give feedback.
-
Thanks Anthony. I've created you a new dedicated Oracle 19 database in AWS in a new isolated VPC with a whilelist for your IP address. |
Beta Was this translation helpful? Give feedback.
-
With the database you provided I was able to verify that it was indeed the fact that TLS renegotiation was not being performed. I've just pushed changes to the repository that ensure that TLS renegotiation is performed when needed. If you are able to build python-oracledb yourself you should be able to connect now. I was able to connect to the database you provided in any case! Thanks for providing that! |
Beta Was this translation helpful? Give feedback.
-
The patch I referenced in the previous comment was included in python-oracledb 1.0.2 which was just released. It should now work properly for you! Thanks for your help. |
Beta Was this translation helpful? Give feedback.
-
I can confirm that v1.0.2 works from both my PC and AWS Lambda to connect to an RDS database over TLS :) Thanks again Anthony, really appreciate the super quick response and release :) A suggestion: a little more information in the docs about exactly how to create a wallet suitable for mutual TLS as pem and how to get it going would be awesome. I'm probably not going to do mutual TLS, but right now it's a bit tricky for people who aren't Oracle experts. |
Beta Was this translation helpful? Give feedback.
-
Hello I can connect via SQL dev - i have confirmed connection details are same for both This is thin client and no wallet (TLS) connection The only change since then is oracle have been reclaiming unused resources however the linux server and the database are still there and accessible I have already raised this in #162 but as of yet I have not found a solution I have posted here in hope that people who had and resolved the problem might be able to help me thanks Paul |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use the Python oracledb library to connect from AWS Lambda to RDS Oracle using TLS. I may want to do mutual TLS, but even one-way TLS would be fine. I could use some help. I'm technical and have plenty of experience, but both Python and Oracle are outside my core skillset - I'm good with Java and I'm full time AWS architect.
What I can do:
Noting that this is not a firewall issue, I have opened up the correct ports in AWS.
Code
Here's the basics of the code for one way TLS, which is very similar to the Oracle example.
Errors
Here's the error message output from lambda (# replaces sensitive information)
What I've tried
Question
Beta Was this translation helpful? Give feedback.
All reactions