Skip to content

Conversation

@anders-p-andersson-vgregion-se
Copy link
Contributor

Description

Add TLS headers to Camel-MLLP consumers when using mTLS, just like camel-netty does for incoming traffic. These headers exposes Subject, certificate validity dates, serial number and issuer name.

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

My Jira issue: https://issues.apache.org/jira/browse/CAMEL-22000

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

public static final String MLLP_SSL_CLIENT_CERT_ISSUER_NAME = "CamelMllpSslClientCertIssuerName";
@Metadata(description = "The SSL client certificate serial number", label = "consumer", javaType = "String")
public static final String MLLP_SSL_CLIENT_CERT_SERIAL_NO = "CamelMllpSslClientCertSerialNo";
@Metadata(description = "The SSL client certificate not before.", label = "consumer", javaType = "String")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the javaType String, or a Date? same for MLLP_SSL_CLIENT_CERT_NOT_AFTER

@Croway
Copy link
Contributor

Croway commented Dec 23, 2025

@anders-p-andersson-vgregion-se a test is failing on the CI

[camel-mllp] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.142 s <<< FAILURE! -- in org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest
[camel-mllp] [ERROR] org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication -- Time elapsed: 0.138 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Unexpected type, expected: <java.net.SocketException> but was: <javax.net.ssl.SSLHandshakeException>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:49)
	at org.junit.jupiter.api.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:31)
	at org.junit.jupiter.api.Assertions.assertInstanceOf(Assertions.java:3614)
	at org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication(MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.java:44)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
[camel-mllp] [INFO] Running org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest
[camel-mllp] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.148 s <<< FAILURE! -- in org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest
[camel-mllp] [ERROR] org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication -- Time elapsed: 0.146 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Unexpected type, expected: <java.net.SocketException> but was: <javax.net.ssl.SSLHandshakeException>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:49)
	at org.junit.jupiter.api.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:31)
	at org.junit.jupiter.api.Assertions.assertInstanceOf(Assertions.java:3614)
	at org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication(MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.java:44)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
[camel-mllp] [INFO] 
[camel-mllp] [INFO] Results:
[camel-mllp] [INFO] 
[camel-mllp] [ERROR] Failures: 
[camel-mllp] [ERROR] org.apache.camel.component.mllp.MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication
[camel-mllp] [ERROR]   Run 1: MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication:44 Unexpected type, expected: <java.net.SocketException> but was: <javax.net.ssl.SSLHandshakeException>
[camel-mllp] [ERROR]   Run 2: MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication:44 Unexpected type, expected: <java.net.SocketException> but was: <javax.net.ssl.SSLHandshakeException>
[camel-mllp] [ERROR]   Run 3: MllpMutualTlsConnectionAndHeaderRequiresClientAuthenticationTest.testSendingTlsWithNoClientCertificateToMllpConsumerWhichRequiresClientAuthentication:44 Unexpected type, expected: <java.net.SocketException> but was: <javax.net.ssl.SSLHandshakeException>
[camel-mllp] [INFO] 
[camel-mllp] [INFO] 
[camel-mllp] [ERROR] Tests run: 334, Failures: 1, Errors: 0, Skipped: 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants