fix: Parse full certificate chain for client certificates#2222
fix: Parse full certificate chain for client certificates#2222thjaeckle merged 1 commit intoeclipse-ditto:masterfrom
Conversation
...ervice/src/main/java/org/eclipse/ditto/connectivity/service/messaging/internal/ssl/Keys.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/eclipse/ditto/connectivity/service/messaging/internal/ssl/Keys.java
Outdated
Show resolved
Hide resolved
8d9ca48 to
d1f4311
Compare
|
Started a systemTests run at: https://github.com/eclipse-ditto/ditto/actions/runs/17616067613 |
Previously the code for parsing the certificate chain for use in connection's client certificate based authentication only parsed the very first certificate of what the user submitted (the client certificate itself), and disregarded all other certificates. This works when the validation path doesn't include any intermediate certificates. However, as soon as an intermediate certificate is introduced everything stops working, because when the server requests a certificate for it's configured client certificate authority, no path can be made and client certificate authentication fails. This commit fixes this issue by properly parsing the full certificate chain.
d1f4311 to
d56247f
Compare
|
Sorry just noticed that there was a problem with the code where it will accept empty certificates chains, should be fixed now. |
|
One relevant System-Test failed: org.eclipse.ditto.testing.system.connectivity.amqp10.Amqp10SaslIT We must look into this before being able to accept the PR. |
I've had a quick look and this test seems to be using hmac credentials and there doesn't seem to be anything involving client certificates (or even amqps) and the timeout error seems a bit suspicious. I'll try to look deeper as soon as I can find the time. |
|
@thjaeckle I've just checked locally and the test passes, seeing as these changes shouldn't affect the test and the error seems to be a timeout I think it's fair to assume it's flakiness on the part of the tests. |
|
Ran another test-run: https://github.com/eclipse-ditto/ditto/actions/runs/17738343683 The test failure/error is still there - and it is not on a run against the "master" branch .. I'll look into it once I find some time. |
|
@thjaeckle I didn't notice at first but the tests include logs This is the relevant logs for the test. Seems like the test can't start the test amqp server because the port is already taken. |
|
@JCapucho thanks, good catch 👍 Run: https://github.com/eclipse-ditto/ditto/actions/runs/17769628910 |
Previously the code for parsing the certificate chain for use in connection's client certificate based authentication only parsed the very first certificate of what the user submitted (the client certificate itself), and disregarded all other certificates.
This works when the validation path doesn't include any intermediate certificates. However, as soon as an intermediate certificate is introduced everything stops working, because when the server requests a certificate for it's configured client certificate authority, no path can be made and client certificate authentication fails.
This PR fixes this issue by properly parsing the full certificate chain.