Skip to content
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

feat: add checkServerIdentity override #2295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brandonjfeldkamp
Copy link

This fixes the issue described by #2119 (comment) and partially resolves #2172.

This doesn't implement the changes described in the issue regarding deprecating the Amazon RDS profile in favor of moving that out to a new package but it does allow for a path forward to re-enabling rejectUnauthorized.

The follow scenarios are now true:

  • Set rejectUnauthorized: false - never any server identity verification

  • Set rejectUnauthorized: true or not provided:

    • set verifyIdentity: true or not provided - run provided checkServerIdentity() or use default tls.checkServerIdentity() function

    • set verifyIdentity: false - checkServerIdentity set to no-op function

How was this tested?

I tested changes locally against a tls-enabled postgresql instance. I'm not sure of how to incorporate any unit or integration tests for this as there does not currently appear to be any. Any support here would be lovely.

@wellwelwel

This comment was marked as outdated.

@brandonjfeldkamp
Copy link
Author

while the code around this change in your active memory - could you also please help reviewing #2295 ? That would be a minor version bump as it adds checkServerIdentity option. I don't like the fact that we would have 2 similarly named flags ( one is flag, one is function with custom check logic ), but might still worth adding

@juanheyns @sidorares regarding this concern of similarly named "things" from #2376, would you like me to rename it? I think this is still important as without it by setting the verifyIdentity flag to false you become more vulnerable to MITM attacks. By overriding the checkServerIdentity function we could enforce server identity in a way that makes sense for us. This is my line of thinking at least, does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR_TLS_CERT_ALTNAME_INVALID error when using CNAME as host name for RDS connection
3 participants