espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
610 stars 257 forks source link

Not connecting to SSL Broker #44

Closed AmrutaCh closed 5 years ago

AmrutaCh commented 6 years ago

Previously I had used your esp8266 mqtt lib with a mosquitto server and it works very well. However, this esp32 lib is failing to connect to the same server. I am using mosquitto server with tls version tlsv1. No certificates are used on the client side, only username and password is used for authentication.

We get the below error in server side:

_error:1408F10B:SSL routines:SSL3_GETRECORD:wrong version number

Below is my mosquitto.conf:

port 1883 listener 8883

log_dest stdout log_type all

allow_anonymous false password_file /etc/mosquitto/password.txt

cafile /home//ca.crt certfile /home//server.crt keyfile /home//server.key tls_version tlsv1

Any insights or suggestions

david-cermak commented 5 years ago

Hi @AmrutaCh

Can you please test it with current version of the library? My mosqutto configuration looks similar

port 8883
cafile /home/david/ssl/mosq_certs/ca.crt
certfile /home/david/ssl/mosq_certs/server2.crt
keyfile /home/david/ssl/mosq_certs/server.key
require_certificate true
use_identity_as_username true
tls_version tlsv1

and esp client connects correctly, no issue with tlsv1

AmrutaCh commented 5 years ago

I don't remember now what was the issue. But I had got it working.