-
Notifications
You must be signed in to change notification settings - Fork 10
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
OP-22232: Added support for secure redis connection #492
Conversation
|
||
System.out.println("Certificate has been added to the KeyStore successfully."); | ||
} catch (Exception e) { | ||
e.printStackTrace(); |
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.
There is no point in proceeding with service initialization when an exception is caught, so please throw the exception appropriately.
keyStore.store(jksOutputStream, password); | ||
jksOutputStream.close(); | ||
|
||
System.out.println("Certificate has been added to the KeyStore successfully."); |
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.
use log
|
||
FileOutputStream jksOutputStream = new FileOutputStream(jksFilePath); | ||
keyStore.store(jksOutputStream, password); | ||
jksOutputStream.close(); |
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.
this should be in finally clause.
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); | ||
FileInputStream certInputStream = new FileInputStream(certFilePath); | ||
Certificate certificate = certificateFactory.generateCertificate(certInputStream); | ||
certInputStream.close(); |
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.
this should be in finally clause.
String alias = "redis-truststore"; // An alias to identify the certificate in the keystore | ||
char[] password = this.password.toCharArray(); // Keystore password | ||
|
||
try { |
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.
Please write some comments clarifying the steps down below.
No description provided.