MQTT:SSL routines:SSL3_GET_RECORD:wrong version number

Solution 1:

On a general note - you should be generating your own certificates, don't use the ones provided by mosquitto for testing, or use the gen.sh script without modifying it for your own details.

To use the certificates provided, you should be using all-ca.crt in the broker. It contains the example root CA and intermediary CA certificates. The client only requires the root CA for verification purposes.

You are using a full path to the certificates in the broker configuration, but relative paths in the client. Are you sure that they are both correct?

Have you tried running the tests unmodified with make test? This would tell you if there is a problem with your openssl installation for example.