Qhttpserver unable to run on https protocol using ssl.
-
wrote on 8 May 2014, 10:59 last edited by
hi,
I am using below code for run Cplusplus RestAPI using "qhttpserver" http server on http protocol. But i want to server run on https protocol. I have spent couple of days to run "qhttpserver" server on https protocols. Please Tell me how we can solve this problem. Reply as soon as possible.int main()
{
QHttpServer server = new QHttpServer(this);
connect(server, SIGNAL(newRequest(QHttpRequest, QHttpResponse*)),
this, SLOT(handleRequest(QHttpRequest*, QHttpResponse*)));
server->listen(QHostAddress::Any, 8080);return 0;
} -
Hi,
Do you know if your QHttpServer supports SSL?
QHttpServer is not part of Qt. Where did you get it from? (I found at least 2 different projects containing "QHttpServer": https://github.com/nikhilm/qhttpserver and http://xmelegance.org/qxservlet/classdocs/classQHttpServer.html )
-
wrote on 9 May 2014, 07:11 last edited by
Hi,
Thanks for reply.
I have post these question to nikhilm github repository.
You are right QHttpServer is not part of Qt. I download these server from https://github.com/nikhilm/qhttpserver. I am trying to solve it. If you got any solution please sent me . -
I've never used QHttpServer before, so I don't know much about it, sorry. It's probably best if you ask the author.
I had a quick look at nikhilm's code, but I couldn't find any built-in SSL support. If you want to use HTTPS, you might need to create and manage your own SSL sockets to transfer the HTTP data. See "QSslSocket":http://qt-project.org/doc/qt-5/QSslSocket.html
-
wrote on 9 May 2014, 12:54 last edited by
Thanks lots for contribute and suggest me .
I ask with author. He give me some ssl "#include <QSslSocket>" and library link . and you are right i need create ssl certificate and manage with QHttpserver server so that HTTPS secure socket will we enable.
Thanks again . If i face some problem then i will contact again. -
You're welcome. :) Good luck!
4/6