ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.43k stars 889 forks source link

CROW_ENABLE_SSL not effective #414

Closed alex-lt-kong closed 1 year ago

alex-lt-kong commented 1 year ago

I would like to enable the SSL support so that I build crow with:

cmake ../ -DCROW_ENABLE_SSL=ON
make -j2
make install

Then my PoC code is the following:

#include "crow.h"

int main()
{
    crow::SimpleApp app;

    CROW_ROUTE(app, "/")([](){
        return "Hello world";
    });

    app.port(18080).ssl_file("test.crt", "test.key").run();
}

However, it doesn't work, g++ complains:

/usr/local/include/crow/app.h: In instantiation of ‘crow::Crow<Middlewares>::self_t& crow::Crow<Middlewares>::ssl_file(T&&, Remain&& ...) [with T = const char (&)[56]; Remain = {const char (&)[56]}; Middlewares = {}; self_t = crow::Crow<>]’:
./src/odcs.cpp:17:29:   required from here
/usr/local/include/crow/app.h:386:41: error: static assertion failed: Define CROW_ENABLE_SSL to enable ssl support.
  386 |               std::is_base_of<T, void>::value,

Is this normal or a bug?