Self-signed CER
I am deploying a container application that consumes MQTT messages from Event Grid and publishes to other MQTT brokers. In testing Event Grid, I created self-signed certs and subscribed to Event Grid using MQTT Explorer. I am able to publish and consume messages with this tool. In building my container app in Java I can connect to the MQTT broker using the self-signed certs but cannot connect to the Event Grid. I isolated my code to a junit test in VSCode, changing the AzureCliCredentialBuilder class instead of DefaultAzureCredentialBuilder and get the same error. The error is
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I've continued tweaking the junit test with no success, I've use InstallCert to add EventGrid certs to my JVM truststore, tried to create a custom trust store, ensured one installed JDK, with no success. I suspect Java is more secure and wants the entire chain while MQTT Explorer and the MQTT broker are more lenient.
I have the intermediate CA certificate loaded in Event Grid MQTT Broker and clients authenticate setting is thumbprint. Do I need a trusted root signed CA Cert? Or am I missing something?