-
Notifications
You must be signed in to change notification settings - Fork 51
chore(QTDI-2053):use safer method to verify certificate #1141
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
base: master
Are you sure you want to change the base?
Conversation
| if (acceptAnyCertificate) { | ||
| builder.hostnameVerifier((host, session) -> true); | ||
| builder.sslContext(createUnsafeSSLContext()); | ||
| } else if (keystoreLocation.isPresent()) { |
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.
Should we check if keystore is present or not, or, simply raise an exception when it is not present ? (maybe a question to @coheigea )
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 assume the code falls back to the JDK defaults if the keystore isn't present? If so that would be OK, and we could just log this.
| builder.hostnameVerifier(hostnameVerifier); | ||
| builder.sslContext(createSSLContext(keystoreLocation, keystoreType, keystorePassword, truststoreType)); | ||
| } else { | ||
| log.warn("Key store location is NOT present. "); |
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'm not sure it is an issue to not have the keystore location defined. If not the default java certificate management will be used.
So maybe just :
log.info("TCK vault-client doesn't explicitly define the keystore location. You can use 'talend.vault.cache.client.vault.certificate.keystore.location' and 'talend.vault.cache.client.vault.certificate.keystore.type' to explicit it.")
or something like this...
|
| builder.hostnameVerifier(hostnameVerifier); | ||
| builder.sslContext(createSSLContext(keystoreLocation, keystoreType, keystorePassword, truststoreType)); | ||
| } else { | ||
| log.info("TCK vault-client doesn't explicitly define the keystore location. Please configure " + |
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.
Isn't a warning more relevant?
undx
left a comment
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.
minor comment

0 New Issues
0 Fixed Issues
0 Accepted Issues
Requirements
Why this PR is needed?
What does this PR adds (design/code thoughts)?