Hello,
We are trying to establish a mqtt connection between a nrf9160 Feather and digitalocean server following your instruction on this website
We have setup a server with mosquitto running on a digital ocean server, and flashed nrf9160 feather with mqtt_simple sample.
However, the MQTT connection does not seem to work properly, we observed error -45
(Operation not supported on socket) from LTE Link Monitor, mosquitto service on server log saids
OpenSSL Error[0]: error 1417C0C7:SSL routines:tls_process_client_certificate:peer did not return a certificate
We made sure our certificates are generated with easy-rsa
following your instructions, also attempted to swap the CA_CERTIFICATE
defined in certificates.h
header file in mqtt_simple
sample with our ca.crt
generated by easy-rsa
on our server, however the error -45
persists.
Then we disabled TLS with CONFIG_MQTT_LIB_TLS=n
in proj.conf
file, error -45
is gone, but error -57
(Socket is not connected) appeared, LTE link monitor outputs
mqtt_simple: MQTT client disconnected: -57
mqtt_simple: mqtt_input: -57
mqtt_simple: Disconnecting MQTT client...
qtt_simple: Could not disconnect MQTT client: -57
And mosquitto service outputs
OpenSSL: OpenSSL Error[0]: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
Client <unknown> disconnected: Protocol error
So I have a few questions:
- Should we replace the CA_CERTIFICATE in
certificates.h
with our ca certificate generated with easy-rsa on server? - Should we place the nrf9160 certificate and key in
certificates.h
also? - How do we resolve the -57 (Socket is not connected) issue?
Thank you,
Ron Zeman