Hi Mark Pope,
It seems like you are facing an issue with connecting to Event Grid from your Java container application due to certificate validation errors. The error message you provided indicates that there is an issue with validating the certificate chain.
In Java, when establishing an SSL connection, the certificate presented by the server needs to be validated against the truststore to ensure it is trusted. If the certificate chain presented by the server is not trusted by the JVM's truststore, you may encounter the "PKIX path building failed" error.
Here are some steps you can take to resolve this issue:
- Make sure that the entire certificate chain, including the root CA certificate, is present in the truststore that your Java application is using. If any intermediate or root CA certificates are missing, the certificate validation will fail.
- While self-signed certificates can work in some scenarios, using a trusted root signed CA certificate is recommended for production environments. Ensure that the root CA certificate used to sign the server certificate is trusted by the JVM.
- Since you mentioned that the clients authenticate using thumbprint, ensure that the thumbprint authentication settings are correctly configured in your Java application.
- Double-check that you have correctly configured your Java application to use the custom truststore where you added the necessary certificates.
- You can enable SSL debugging in Java to get more detailed information about the SSL handshake process. This can help you identify where the certificate validation is failing.
To help you better understand, kindly refer to the documentations below :
https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ
https://learn.microsoft.com/en-us/answers/questions/2125243/how-to-use-a-ca-signed-certificate-in-event-grid-n
https://learn.microsoft.com/en-us/azure/event-grid/mqtt-client-certificate-authentication
By ensuring that the entire certificate chain is present in the truststore, using a trusted root signed CA certificate, and verifying your truststore configuration, you should be able to establish a secure connection to Event Grid from your Java container application.