How to run Mongoose HTTPS server

User avatar
gost.404
Posts: 19
Joined: Sat Jul 01, 2017 5:48 pm

How to run Mongoose HTTPS server

Postby gost.404 » Sun Jul 02, 2017 10:16 am

Hi All!

I'm trying to run a HTTPS server and I already run up HTTP version.
After that I found example in Mongoose official docs https://docs.cesanta.com/mongoose/master/#/http/ssl.md/ and also see pcbreflux example of ssl_webserver. I was alert to various methods of certification and key specifying and I start walk down in Mongoose method:

Code: Select all

 mg_bind_opt() -> mg_ssl_if_conn_init() -> mg_use_cert() -> SSL_CTX_use_certificate_file() 
Here the definition of SSL_CTX_use_certificate_file():

Code: Select all

int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type)
{
    return 0;
}
So what the question: can I to use Mongoose HTTPS server without changing its implementation and, if can, how to do this?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How to run Mongoose HTTPS server

Postby WiFive » Sun Jul 02, 2017 6:23 pm


User avatar
gost.404
Posts: 19
Joined: Sat Jul 01, 2017 5:48 pm

Re: How to run Mongoose HTTPS server

Postby gost.404 » Mon Jul 03, 2017 5:54 pm

WiFive, I understand, this question will be more correct to ask on Mongoose forum, but the last function in that chain (SSL_CTX_use_certificate_file) is a part of esp-idf

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How to run Mongoose HTTPS server

Postby WiFive » Tue Jul 04, 2017 5:00 am

I think the answer is that the mongoose in mongoose-os has changes to support esp32 so you should consider using that.

Otherwise you can switch to one of the methods for reading certificates that is supported by esp-idf openssl wrapper.

Who is online

Users browsing this forum: No registered users and 121 guests