crowsite/libs/crow/examples/ssl/example_ssl.cpp

27 lines
483 B
C++
Raw Normal View History

2023-08-25 03:48:59 -04:00
#include "crow.h"
int main()
{
crow::SimpleApp app;
CROW_ROUTE(app, "/")
([]() {
return "Hello world!";
});
app.port(18080).ssl_file("test.crt", "test.key").run();
// Use .pem file
//app.port(18080).ssl_file("test.pem").run();
// Use custom context; see asio::ssl::context
/*
* crow::ssl_context_t ctx;
* ctx.set_verify_mode(...)
*
* ... configuring ctx
*
* app.port(18080).ssl(ctx).run();
*/
}