The entire SSL part of HTTPS is handled in mongoose 'under the hood', i.e. internally.
To make it happen, you need to instruct mongoose, via the configuration, to listen to an SSL-enabled port, e.g. "443s" (note the 's'! You can also have HTTPS on any other port, just append 's' and you're good to go)
For SSL-enabled connections, the connection->use_ssl flag will be set.
(Side note; don't know if this is relevant but still here as a reminder: you cannot have multiple protocols on a single listening port. So offering both plaintext and encrypted communication modes would require mongoose to listen to 2 ports, e.g. "8081, 8082s" where '8082' would then be the port to connect to via HTTPS, e.g. request URL in browser: "https://my.mongoose.domain:8082/path" vs. "http://my.mongoose.domain:8081/path" )
MG_INIT_SSL can be used to add your own certificates via the API during the event callback; any HTTPS connection will be fully established before it will reach MG_NEW_REQUEST as for that event to fire, mongoose must already have fetched the complete HTTP(!) request header from the connection, hence a significant bit of SSL-based traffic will already have happened by then. SSL comm failures will trigger an error code in mg_read/mg_write, like any other I/O failure.
--
You received this message because you are subscribed to the Google Groups "mongoose-users" group.