crow icon indicating copy to clipboard operation
crow copied to clipboard

Crow server not responding when TLS is used

Open jilvin opened this issue 7 years ago • 4 comments

Code:

#define CROW_ENABLE_SSL #include "dependencies/crow_all.h"

int main() { crow::SimpleApp app;

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

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

}

Compiling Statement

g++ src/authentication.cpp -o build/authentication -std=c++11 -lboost_thread -lboost_system -pthread -lssl -lcrypto

Execution

screenshot from 2017-10-21 10-16-45

Response on Web Browser

screenshot from 2017-10-21 10-18-17

Generated test.crt and test.key (compressed)

test.crt+test.key.zip

jilvin avatar Oct 21 '17 04:10 jilvin

Did you use https in your url? try https://127.0.0.1:18080/

moneroexamples avatar Nov 20 '17 04:11 moneroexamples

@moneroexamples I am currently using crow with apache2 server. HTTPS encryption is functional between Apache server and the client.

jilvin avatar Nov 21 '17 15:11 jilvin

It should work. I am using crow with nginx server and nd HTTPs encryption work very well. Question : Are you testing it on local machine or Have you deployed it on some cloud ?

Shravan40 avatar Nov 22 '17 02:11 Shravan40

If you're using Apache as the front end server with HTTPS and it's proxying requests to crow, then you don't need to use HTTPS between Apache and crow unless you're worried about the local traffic between them being intercepted.

The only thing I can think of is that Apache is refusing the SSL certificate since it looks to be self-signed. You might want to check the Apache logs.

pierobot avatar Nov 23 '17 20:11 pierobot