Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

F/ssl certificate checking #96

Open
wants to merge 7 commits into
base: wNetty41
Choose a base branch
from
Open

F/ssl certificate checking #96

wants to merge 7 commits into from

Conversation

marakiis
Copy link
Contributor

Better validation of SSL certificate

@marakiis marakiis requested a review from bcarlin March 27, 2018 12:56
} catch (CertificateExpiredException e) {
//TODO Certificate Handling: Pretify ToString
if(!valid) {
throw new CertificateExpiredException("The folowing certificate has expired\n"
Copy link
Member

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)
Copy link
Member

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)) {
Copy link
Member

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 ?

Copy link
Member

@bcarlin bcarlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in-code comments

@fredericBregier
Copy link
Contributor

Great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants