-
Notifications
You must be signed in to change notification settings - Fork 76
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
Feat: improve SSL error logging/unwrapping #178
Conversation
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 debug logging question, otherwise LGTM
} catch (CertificateException ex) { | ||
Throwable cause = ex.getCause(); | ||
if (cause != null && "Empty input".equals(cause.getMessage())) { | ||
continue; |
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.
Is there a case for debug
or trace
logging upon receiving this error, or is it always benign?
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.
good call, I simply converted from the .rb parts and did not revisit with potential logging.
the whole logic seems a bit unusual - would rather just use generateCertificates
to read multiple entries.
anyhow, let's keep that as before and I am going to add a debug line around the caught "empty" exception.
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.
added debug logging + an extra check when expecting to read at least one certificate from ssl_cert
also worth noting (in the changelog) we no longer have the side effect of setting up the BC provider globally.
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.
LGTM
With the Ruby -> Java rewrite in #178 we avoided installing the BC provider at runtime. Unfortunately to be able to decrypt some openssl keys the BC class relies on the fact that the provider is available. Otherwise reading the key leads to a `PBKDF-OpenSSL SecretKeyFactory not available`
To be able to easily log full Java SSL exception details, we first move the SSL builder to Java.
otherwise this is ~ same as logstash-plugins/logstash-input-beats#405 :
NOTE: we also avoid installing the bouncy-castle security provider at runtime, done previously
resolves #177