Closed afridali123 closed 2 years ago
Hello @afridali123
The HAVE_SNI
option should be defined in wolfSSL, using ./configure --enable-sni
(or HAVE_SNI
in the user_settings.h header).
can you guide me where this user_settings.h ??
How are you building the library wolfSSL?
i m just using steps guide in github through make running mqttclient example
Okay, great. The TLS features of wolfMQTT require wolfSSL https://github.com/wolfSSL/wolfssl
When you build wolfSSL:
./configure --enable-sni
make
sudo make install
Then wolfMQTT:
./configure
make
Then you will have access to the TLS features in wolfMQTT.
that i m aware of that, but eventhough i did ./configure --enable-sni this one while running ./mqttclinet i need to pass -S by this i want to avoid that instead if HAVE_SNI is defined, then mqttCtx.host will be assigned to mTlsSnihostname
i want to tell wolfssl that take mqttCtx.host as sni host, where can i define that in wolfssl library
Ah... You can use the -h
parameter to specify the host. The -S
is for servers that require the Server Name Indicator extension.
Here is an example:
HiveMQ Cloud
./examples/mqttclient/mqttclient -h 833f87e253304692bd2b911f0c18dba1.s1.eu.hivemq.cloud -t -S -u wolf1 -w NEZjcm7i8eRjFKF -p 8883
i dont want to pass any parameters, i want already defined host server address in mqttCtx.host = "" in mqttclient.c
where can i define HAVE_SNI in wolfssl library ??
When you configure wolfSSL with --enable-sni
, the define for HAVE_SNI
is added to the generated file wolfssl/options.h
. This file is included by the wolfMQTT library.
how wolfMQTT linked to wolfssl in which file we can set this HAVE_SNI define so that wolfMQTT client example can work without any parameters
but when i run ./mqttclient its not working when i run ./mqttclient -S "host name" then only its working (TLS enabled)
wolfMQTT client example can work without any parameters
It sounds like you want write your own client. The simple example is very straightforward and is a good basis for your project: https://github.com/wolfSSL/wolfMQTT/tree/master/examples/mqttsimple
yep i tried defining #define HAVE_SNI in mqttsimple.h and compiled code & its not working is it the right way
i hope you are getting my point
i want to run mqttclinet example without passing -S parameter since im already giving host in mqttCtx->host . how can i set that
hi,
i m running example of ./mqttclient -S "host"
i went through code and found if we define HAVE_SNI then it will take mqttCtx.host as tls host. can you please help me in where i can define HAVE_SNI , can i define in mqttclient.h file ??