ArduinoMongoose icon indicating copy to clipboard operation
ArduinoMongoose copied to clipboard

SSL connections

Open flyvfr opened this issue 1 year ago • 2 comments

Have been troubleshooting ssl connections with MongooseHttpClient. In there, the "send" function does the following to get the default options: Mongoose.getDefaultOpts(&opts);

However, the getDefaultOpts has a second "secure" parameter which is defaulted to false, and it appears the rootCAs will never be set in the options when calling the mg_connect_http_opt function (even if the url starts with https protocol)?

This was the first stumbling block when debugging the Failed to make ssl connection error.

flyvfr avatar Feb 14 '24 19:02 flyvfr

Thanks for the report, this would indeed seem to be a bug, the HTTP client shoud do something similar to https://github.com/jeremypoulter/ArduinoMongoose/blob/master/src/MongooseMqttClient.cpp#L141

jeremypoulter avatar Feb 14 '24 20:02 jeremypoulter

Interestingly, my connection seems to work now with https, I think my failure was due to a memory issue. Now, I do wonder if the server cert validation is actually happening since that secure flag is not being set. -g

From: Jeremy Poulter @.> Reply-To: jeremypoulter/ArduinoMongoose @.> Date: Wednesday, February 14, 2024 at 12:21 PM To: jeremypoulter/ArduinoMongoose @.> Cc: flyvfr @.>, Author @.***> Subject: Re: [jeremypoulter/ArduinoMongoose] SSL connections (Issue #36)

Thanks for the report, this would indeed seem to be a bug, the HTTP client shoud do something similar to https://github.com/jeremypoulter/ArduinoMongoose/blob/master/src/MongooseMqttClient.cpp#L141

— Reply to this email directly, view it on GitHubhttps://github.com/jeremypoulter/ArduinoMongoose/issues/36#issuecomment-1944532387, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEVGGT45N46HSXA4MAWSWEDYTUMGJAVCNFSM6AAAAABDI3KB5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGUZTEMZYG4. You are receiving this because you authored the thread.Message ID: @.***>

flyvfr avatar Feb 15 '24 01:02 flyvfr