You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "efegokdemir (via GitHub)" <gi...@apache.org> on 2026/10/08 21:26:21 UTC

[PR] Honor Cassandra hostname verification setting [logging-log4j2]

efegokdemir opened a new pull request, #4395:
URL: https://github.com/apache/logging-log4j2/pull/4395

   Fixes #4350.
   
   The Cassandra appender now honours `log4j2.sslVerifyHostName` when TLS is enabled, configuring HTTPS endpoint identification only when the property is true. The default driver behaviour is preserved otherwise. The manual now documents the actual `useTls` default and the hostname-verification property.
   
   Validation:
   
   * [x] Based on `2.x`
   * [ ] `./mvnw verify` succeeds (the full verify lifecycle with tests was not run)
   * [x] Changelog entry added
   * [x] Regression tests provided
   
   Executed `./mvnw -pl :log4j-cassandra -am -Dtest=CassandraManagerTest -Dsurefire.failIfNoSpecifiedTests=false test`, `./mvnw -pl :log4j-cassandra spotless:check`, and `./mvnw -pl :log4j-cassandra -DskipTests verify`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Honor Cassandra hostname verification setting [logging-log4j2]

Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #4395:
URL: https://github.com/apache/logging-log4j2/pull/4395#discussion_r4306430783


##########
log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java:
##########
@@ -172,7 +178,11 @@ public CassandraManager createManager(final String name, final FactoryData data)
                     .addContactPointsWithPorts(data.contactPoints)
                     .withClusterName(data.clusterName);
             if (data.useTls) {
-                builder.withSSL();
+                if (PropertiesUtil.getProperties().getBooleanProperty(VERIFY_HOST_NAME_PROPERTY, false)) {

Review Comment:
   I think instead of this we should start using the latest version https://mvnrepository.com/artifact/org.apache.cassandra/java-driver-core/4.19.4 `com.datastax.oss.driver.api.core.CqlSession` API 
   
   and then something like 
   ```
   builder.withSslEngineFactory(new ProgrammaticSslEngineFactory(
               SSLContext.getDefault(),
               null,
               verifyHostName));
   ```
   
   Ref https://github.com/Shekharrajak/cassandra-java-driver/blob/trunk/core/src/main/java/com/datastax/oss/driver/api/core/ssl/ProgrammaticSslEngineFactory.java#L80 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Honor Cassandra hostname verification setting [logging-log4j2]

Posted by "ramanathan1504 (via GitHub)" <gi...@apache.org>.
ramanathan1504 commented on PR #4395:
URL: https://github.com/apache/logging-log4j2/pull/4395#issuecomment-6300080153

   #4374 is open for #4350 since 30 September, with the same `RemoteEndpointAwareJdkSSLOptions` subclass.
   `CassandraManagerTest` here is the manager-level test asked for on #4374. Can we agree on one PR, for example by bringing this test into #4374?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Honor Cassandra hostname verification setting [logging-log4j2]

Posted by "ramanathan1504 (via GitHub)" <gi...@apache.org>.
ramanathan1504 closed pull request #4395: Honor Cassandra hostname verification setting
URL: https://github.com/apache/logging-log4j2/pull/4395


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Honor Cassandra hostname verification setting [logging-log4j2]

Posted by "ramanathan1504 (via GitHub)" <gi...@apache.org>.
ramanathan1504 commented on PR #4395:
URL: https://github.com/apache/logging-log4j2/pull/4395#issuecomment-6517033307

   Closing as a duplicate of #4374. It has the same fix and now also tests the `log4j2.sslVerifyHostName` check in `CassandraManager`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Honor Cassandra hostname verification setting [logging-log4j2]

Posted by "ramanathan1504 (via GitHub)" <gi...@apache.org>.
ramanathan1504 commented on code in PR #4395:
URL: https://github.com/apache/logging-log4j2/pull/4395#discussion_r4329599025


##########
log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraManager.java:
##########
@@ -172,7 +178,11 @@ public CassandraManager createManager(final String name, final FactoryData data)
                     .addContactPointsWithPorts(data.contactPoints)
                     .withClusterName(data.clusterName);
             if (data.useTls) {
-                builder.withSSL();
+                if (PropertiesUtil.getProperties().getBooleanProperty(VERIFY_HOST_NAME_PROPERTY, false)) {

Review Comment:
   The 2.x module stays on driver 3.x. Driver 4 moved to `com.datastax.oss` with a new package root, and Cassandra majors are ignored in `.github/dependabot.yaml` since #4305 (see #4210).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org