Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Mosquitto & TLS Problems

Hi,
that's the code:

int MQTTClient::connect( char *host, char *user, char *pwd, int port )
{
username_pw_set( user, pwd );
tls_set( "../../certificate/CA.crt" );
tls_opts_set( SSL_VERIFY_PEER, "tlsv1.2", NULL );
mosqpp::mosquittopp::connect( host , port, KEEPALIVE );
return SUCCESS;
}

MQTTClient is my class that manage all the operation about MQTT.
I canceled all result checks to simplify the reading.

Bye,
Alessio



On 23 September 2015 at 22:43, Roger Light <roger@xxxxxxxxxx> wrote:
Hi Alessio,

Hmm, ok. Can you share some simple code that recreates the problem?
The simplest code that code generate this problem would be:

mosquitto_lib_init();
mosq = mosquitto_new("id", true, NULL);
mosquitto_connect(mosq, "localhost", 1883, 60);

If that fails for you, then I'd ask which version of mosquitto and
openssl you are using.

Cheers,

Roger


On Wed, Sep 23, 2015 at 7:10 PM, alessio troiano <alessio@xxxxxxxx> wrote:
> Hi Alexandre and Roger,
> thank you for your suggestions, but:
> 1) there is no problem with ciphers or TLS version, because I successfully
> published with mosquitto_sub using the same parameters that I set in my
> application;
>
> 2) I call mosquitto_lib_init().
>
> Thank you,
> Alessio
>
> On 22 September 2015 at 17:46, Roger Light <roger@xxxxxxxxxx> wrote:
>>
>> Hi Alessio,
>>
>> I imagine you are forgetting to call mosquitto_lib_init() first.
>>
>> Cheers,
>>
>> Roger
>>
>>
>> On Tue, Sep 22, 2015 at 4:01 PM, alessio troiano <alessio@xxxxxxxx> wrote:
>> > Hi all,
>> > I trying to develop a mqtt client with server authentication through
>> > certificates, but the library tell me "Unable to create TLS context".
>> > I tried with mosquitto client and openssl command line tool, and there
>> > are
>> > no problems connecting to the broker.
>> >
>> > Can you help me?
>> > Thank you
>> > AlTro
>> >
>> > _______________________________________________
>> > mosquitto-dev mailing list
>> > mosquitto-dev@xxxxxxxxxxx
>> > To change your delivery options, retrieve your password, or unsubscribe
>> > from
>> > this list, visit
>> > https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>
>
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top