Skip to content

3.1.0: The distinguished name (DN) on the server certificate does not match the expected value #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tvb opened this issue Apr 24, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@tvb
Copy link

tvb commented Apr 24, 2025

  1. What versions are you using?

AWS Lambda Python 3.11 with a lambda layer for the oracledb module (otherwise the Lambda function is too large and won't be able to upload):

platform.platform: Linux-5.10.235-247.919.amzn2.x86_64-x86_64-with-glibc2.26
--
sys.maxsize > 2**32: True
platform.python_version: 3.11.11
oracledb.__version__: 3.1.0

  1. Is it an error or a hang or a crash?

Crash.

  1. What error(s) or behavior you are seeing?

When trying to connect to an AWS RDS Oracle Database we see the following behaviour:

Actual DN from RDS:

commonName=production-oracle-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com,organizationalUnitName=RDS,organizationName=Amazon.com,localityName=Seattle,stateOrProvinceName=Washington,countryName=US

Error from Lambda:

$DPY-6005: cannot connect to database (CONNECTION_ID=xpBd39yXJCX7bySrkAsebA==).\nDPY-6002: The distinguished name (DN) on the server certificate does not match the expected value: 'CN=production-oracle-xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com,OU=RDS,O=Amazon.com,L=Seattle,ST=Washington,C=US'

(xxxxx is obsecured for company reason)

  1. Does your application call init_oracle_client()?

It is running in thin mode.

  1. Include a runnable Python script that shows the problem.

That is complicated and frankly impossible.

@tvb tvb added the bug Something isn't working label Apr 24, 2025
@tvb tvb changed the title 3.1.0 3.1.0: The distinguished name (DN) on the server certificate does not match the expected value Apr 24, 2025
@tvb
Copy link
Author

tvb commented Apr 25, 2025

Turns out that in our code

        if self.server_cert_dn:
            security = f"(SECURITY=(SSL_SERVER_CERT_DN='{self.server_cert_dn}'))"

the '' around {self.server_cert_dn} now breaks for some reason. This was not the case before. We're not sure what is changed and when, but removing the single quotes fixed it for us.

@tvb tvb closed this as completed Apr 25, 2025
@cjbj
Copy link
Member

cjbj commented Apr 25, 2025

@tvb were you previously using an older version of python-oracledb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants