Page 1 of 1

How to run Mongoose HTTPS server

Posted: Sun Jul 02, 2017 10:16 am
by gost.404
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?

Re: How to run Mongoose HTTPS server

Posted: Sun Jul 02, 2017 6:23 pm
by WiFive

Re: How to run Mongoose HTTPS server

Posted: Mon Jul 03, 2017 5:54 pm
by gost.404
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

Re: How to run Mongoose HTTPS server

Posted: Tue Jul 04, 2017 5:00 am
by WiFive
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.