pmalhaire / xk6-mqtt

k6 mqtt extension
Apache License 2.0
47 stars 37 forks source link

Connection error with mqtt cert #11

Closed samerhijazi closed 1 year ago

samerhijazi commented 2 years ago

Hi, i am trying to make connection with cert with the following setting and i get "connection error". Is there a way to debug. Or do i do it wrong.

It does work for a local HivemQ without cert.

Thanks Samer

image

pmalhaire commented 2 years ago

Hello, What is the error you are getting ?

The code for this part is in client.go

samerhijazi commented 2 years ago

Hello,

the problem is with cert. But the file is correct.

image

pmalhaire commented 1 year ago

Hi, I fixed it and pushed the fix on the main branch.

alvinjoseph7 commented 9 months ago

Hi, I'm facing a similar publish connect error when trying to publish to a mosquitto broker(mosquitto version 1.4.15) with my self-signed certificate. Publish to the 1883 port works well, but connection to port 8883 is causing this issue.

image

Mosquitto logs: image

I am pretty that I am using the correct CA certificate file(.pem format) in my script to authenticate because when I use the mosquitto_pub tool with the same CA cert, I am able to connect to the broker(8883 port).

K6 Script file: pub.txt

pmalhaire commented 9 months ago

@alvinjoseph7 maybe you can reproduce It with more details. The CI is testing this, so it's working, not that TLS 1.3 Is enforced.

alvinjoseph7 commented 9 months ago

Hi, I was able to fix the issue. The problem was with the self-signed certificates I was using. This link finally helped me out: http://www.steves-internet-guide.com/mosquitto-tls/