-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added graceful downgrade from TLS security enabled to disabled if a TLS CLIENT_KEY is not provided #11
Conversation
# this assumes set to a path. It could be set to True in which case we need | ||
# to return the default path | ||
|
||
server_cert = env.get('NUOCMD_VERIFY_SERVER', os.environ.get('NUOCMD_VERIFY_SERVER', False)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server_cert can also be missing. In 4.2 we no longer ship either the server cert or the client cert.
A missing server_cert file is "OK" in python?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should downgrade if the client key exists. If someone went through the trouble to create nuocmd.pem
, but they forgot to create or misplaced (e.g. they called it /etc/nuodb/keys/ca.crt
instead of /etc/nuodb/keys/ca.cert
) the server certificate, then they would probably be expecting HTTPS to be used.
I'm also being more defensive about downgrading here because I can't tell if the argument was resolved from an environment variable or an explicit argument, (nuocmd
only downgrades when the explicit arguments are not specified).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that we should check server_cert
file existence. Otherwise the changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that the verify certificate file is not used even if provided in case the protocol is downgraded.
No description provided.