B4J Code Snippet how to connect to a MQTT broker that requires a client certificate

jGubern

Member
Licensed User
Hi,

I am trying to create a client application for devices with AWS IoT broker.

I think this example could help me but I think I am not doing something right when importing the Bouncy jar.

I have added in the header
B4X:
#AdditionalJar: bcprov-jdk15on-165/

and I have placed the bcprov-jdk15on-165.jar in additional libraries.


I get this error (release mode)
bouncyError.PNG


Obviously, I'm not a Java expert (that's why I use b4x). :p

any help? Thanks!
 

jGubern

Member
Licensed User
Thanks Erel, but so I have it in the code
The slash was an error writing the post not writing code in my program

Any other idea?
Thank you.
 

jGubern

Member
Licensed User
Thanks for your interest,

message error:

----------
B4J Versión: 8.10
Java Versión: 8
Parseando código. (0.00s)
Building folders structure. (0.00s)
Compilando código. (0.01s)
Compilado códigos de diseños. (0.00s)
Organizando librerías. (0.00s)
Compilando el código Java generado. Error
javac 1.8.0_241
src\b4j\example\main.java:16: error: package org.bouncycastle.cert does not exist
import org.bouncycastle.cert.X509CertificateHolder;
^
1 error
-------------

Line 16 Java in Main.java
import org.bouncycastle.cert.X509CertificateHolder;

Thanks.
 

madru

Active Member
Licensed User
Longtime User
you will need those to get it running:

B4X:
    #AdditionalJar: bcprov-jdk15on-160
    #AdditionalJar: bcpkix-jdk15on-164
 

Similar Threads

Replies
56
Views
46K
  • Locked
  • Article
B4J Library MqttBroker
Replies
51
Views
31K
  • Locked
  • Article
B4J Tutorial [IoT] MQTT Protocol
Replies
33
Views
39K
Top