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

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: Copy
#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!
 
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.
 
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.
 
you will need those to get it running:

Code: Copy
    #AdditionalJar: bcprov-jdk15on-160
    #AdditionalJar: bcpkix-jdk15on-164
 

Similar Threads

Back
Top