eclipse-paho / eclipse-paho/paho.mqtt.java
How to set CA certificate in client to connect to vernemq broker
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
I have enabled SSL in vernemq broker with CA certificate and server certificate to make the communication to vernemq encrypted.
So I am building a paho client. I tried to connect with the broker without specifying any certificate and I was getting an error [PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]. I used MQTT.fx client which was developed with Paho client lib and I was able to connect to the broker only after selecting CA Certificate file and providing them.
I look at the samples around and found all of them provides CA certificate and a client certificate to communicate.
Can anyone help me to connect to the broker by using CA certificate? Is there any parameter to set in 'setSocket' to only use CA certificate to communicate? Can anyone share me some samples to connect in this way?
Contributor guide
Assessment
This issue has not been assessed yet.