Hi,
I have a problem with mqtt library version 1.01
I have to connect via ssl connection to my mosquitto server;
I followed the tutorial at this link https://www.b4x.com/android/forum/threads/b4x-mqtt-ssl-and-self-signed-certificates.100973/#content, but I have these errors
(SSLProtocolException) javax.net.ssl.SSLProtocolException: Read error: ssl=0xb400006f97393288: Failure in SSL library, usually a protocol error
error:1000045c:SSL routines:OPENSSL_internal:TLSV1_ALERT_CERTIFICATE_REQUIRED (external/boringssl/src/ssl/tls_record.cc:594 0xb400006f9e55c848:0x00000001) and the connection does not take place.
What could be the cause of the problem?
This is my code:
I have a problem with mqtt library version 1.01
I have to connect via ssl connection to my mosquitto server;
I followed the tutorial at this link https://www.b4x.com/android/forum/threads/b4x-mqtt-ssl-and-self-signed-certificates.100973/#content, but I have these errors
(SSLProtocolException) javax.net.ssl.SSLProtocolException: Read error: ssl=0xb400006f97393288: Failure in SSL library, usually a protocol error
error:1000045c:SSL routines:OPENSSL_internal:TLSV1_ALERT_CERTIFICATE_REQUIRED (external/boringssl/src/ssl/tls_record.cc:594 0xb400006f9e55c848:0x00000001) and the connection does not take place.
What could be the cause of the problem?
This is my code:
B4X:
Sub Connect
mqtt.Initialize("mqtt", "ssl://10.10.10.81:8883", "id")
Dim mo As MqttConnectOptions
mo.Initialize("user", "password")
TrustAll(mo)
mqtt.Connect2(mo)
End Sub
Sub TrustAll (mo As MqttConnectOptions)
Dim SSLContext As JavaObject
SSLContext = SSLContext.InitializeStatic("javax.net.ssl.SSLContext").RunMethod("getInstance", Array("TLS"))
Dim tm As CustomTrustManager
tm.InitializeAcceptAll
SSLContext.RunMethod("init", Array(Null, tm, Null))
Dim jmo As JavaObject = mo
jmo.RunMethod("setSocketFactory", Array(SSLContext.RunMethod("getSocketFactory", Null)))
End Sub