-
Notifications
You must be signed in to change notification settings - Fork 5
F/ssl certificate checking #96
base: wNetty41
Are you sure you want to change the base?
Conversation
} catch (CertificateExpiredException e) { | ||
//TODO Certificate Handling: Pretify ToString | ||
if(!valid) { | ||
throw new CertificateExpiredException("The folowing certificate has expired\n" |
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.
- typo on "folowing"
- do not put newlines in logs... It makes ther harder to parse (f.ex: a grep would not show which certificate the message is about)
logger.error("Failed to initialize the client-side SSLContext", e); | ||
throw new Error("Failed to initialize the client-side SSLContext", | ||
e); | ||
} | ||
} | ||
} | ||
|
||
private SSLContext createSslContext(WaarpSecureKeyStore ggSecureKeyStore) |
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.
YAY !
} catch (CertificateExpiredException e) { | ||
logger.error("The certificate " + alias + | ||
" has expired and will be removed from the keystore."); | ||
if (!deleteKeyFromKeyStore(alias)) { |
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 works well for truststores (it keeps them clean), but it does not work for keystores and adminstores : the cert is discarded, the server still listens on TLS ports, and connection attempts result in "io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: no cipher suites in common" unhandled exceptions.
There should be a flag to decide whether it should be cleaned or not.
Going further : is it possible, higher at server start, to disable the SSL component which has an invalid certificate (R66 SSL for keystore and the admin HTTP interface for the adminstore) with a critical log ?
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.
in-code comments
Great! |
…ssl.WaarpSecureKeyStore
Finetune keystore verification
Better validation of SSL certificate