Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] mosquitto_tls_set() returns invalid function arguments

Hi Karl,

Thanks for the pointer. I've been pulling my hair out on this one.
I did check previously too about the directory issue, but did not spot any.

Checking again, I did realize to my embarrassment that the QT build directory
is different from the source directory. The certificate was in the
other directory.
As a result, the binary could not find the certificate from the relative path.

Changed to absolute and a single path, that problem got fixed.
const char *CA_CERT = "C:/Program Files/mosquitto/certs_v4/ca.crt"; //
CA Certificate (PEM)

Mosquitto lib initialized, ret: 0
New Mosquitto Session instantiated
Setup done, connected to Broker


Thanks and sorry about the noise.

Manu


On Wed, Sep 2, 2020 at 3:26 PM Karl Palsson <karlp@xxxxxxxxxxxx> wrote:
>
>
> Are you sure your working directory is correct? Are you sure the
> file is correct? Are you sure the file is readable by the process
> running?
>
> Manu Abraham <abraham.manu@xxxxxxxxx> wrote:
> > Greetings,
> >
> > I have been trying to get a lib mosquitto based client working.
> >
> > Added in what I have been trying to do.
> >
> > But mosquitto_tls_set() returns 3, Invalid function arguments
> > provided
> >
> > Any idea, why ?
> >
> > Thanks,
> >
> > Manu
> >
> > --
> >
> > const char *CA_CERT = "./ca.crt"; // CA Certificate (PEM)
> >
> > ret = mosquitto_lib_init();
> > mosq = mosquitto_new(NULL, clean_session, NULL);
> > mosquitto_log_callback_set(mosq, mosq_log_callback);
> > ret = mosquitto_tls_insecure_set(mosq, true);
> > ret = mosquitto_tls_set(mosq, CA_CERT, NULL, NULL, NULL, NULL);
> >
> >
> > Mosquitto lib initialized, ret: 0
> > New Mosquitto Session instantiated
> > ERROR: moquitto_tls_set, ret: 3 , Invalid function arguments
> > provided. ERROR: Setup failed, ret: 3 Invalid function
> > arguments provided.
> > _______________________________________________ mosquitto-dev
> > mailing list mosquitto-dev@xxxxxxxxxxx To unsubscribe from this
> > list, visit
> > https://www.eclipse.org/mailman/listinfo/mosquitto-dev_______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top