-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Reload key and certs in SockerAppender reconnector #2767
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
Conversation
Signed-off-by: MichaelMorris <michael.morris@est.tech>
I'm not in favor of repurposing
@MichaelMorrisEst, @ppkarwasz, what do you think of the following instead?
|
Reloading the cryptographic material alone does not solve the problem in LOG4J2-2988: In fact two
I would have used
I think the scheduler could just call |
For one, I don't think it is correct to keep the state (i.e., @ppkarwasz, in the light of your feedback, I revised my proposal as follows:
@ppkarwasz, is it so? Can't we instead create a new |
Sounds good to me. We can generate the id based on the issuers and serial numbers of the certificates in the two key stores.
Do we really need to poll for configuration changes? Apache Tomcat does not poll the key stores for changes (see Can Tomcat reload its SSL certificate without being restarted?) forcing users to either restart the server when the server certificate changes or to use JMX. Since the OP of I am not strongly opinionated about this, but I believe that
I admit, I have mixed feelings about this:
|
@ppkarwasz, you've have a point. Given this, aren't we practically done after introducing |
Yes, this would be my preferred approach. |
@MichaelMorrisEst, would you be interested in updating your PR with the following changes?
|
Thanks @vy and @ppkarwasz for the review and the great discussion. I will update the PR with the suggested approach |
Signed-off-by: MichaelMorris <michael.morris@est.tech>
b33ed81
to
580ec20
Compare
@MichaelMorrisEst, we have noticed your changes, thanks! We are busy with getting the |
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Signed-off-by: MichaelMorris <michael.morris@est.tech>
@MichaelMorrisEst, we discussed how to proceed this with @ppkarwasz and we would like to carry out some further changes regarding how the SSL-related resources are generated. Would you mind giving myself and @ppkarwasz write access to your fork? So that we can push our changes to your branch and stick to this PR effectively. |
- Revamp SSL key store generation script - Remove redundant SSL certificates, key stores, etc. - Improve SSL tests
No problem, you should have received notification, any problems let me know |
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.
Great work! 💯
I think this PR needs a little bit of massaging to remove most of the complexity of SslConfiguration
. We should consider only two cases:
- the user provides valid configuration values for all parameters,
- one configuration parameter is invalid. In this case we refuse to connect via TLS.
...e-test/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderReconnectTest.java
Outdated
Show resolved
Hide resolved
...e-test/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderReconnectTest.java
Show resolved
Hide resolved
log4j-core-test/src/test/java/org/apache/logging/log4j/core/net/ssl/SslKeyStoreConstants.java
Show resolved
Hide resolved
log4j-core-test/src/test/resources/org/apache/logging/log4j/core/net/ssl/generate-stores.sh
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/package-info.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java
Show resolved
Hide resolved
@MichaelMorrisEst, this fix will be delivered in |
Remember to port it to |
Co-authored-by: Michael Morris <michael.morris@est.tech>
This PR aims to address LOG4J2-2988 by reloading the keystore and truststore from file when getting the SslSocketFactory during a reconnection attempt, as per suggestion in second paragraph of comment: https://issues.apache.org/jira/browse/LOG4J2-2988?focusedCommentId=17260491&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17260491