Problem with creating ssl server using QSslSocket
-
Hey there, you might take a look into QtWebServer. This is a plug and play ssl server library that you can use for your own apps. It already has SSL support available and is very easy to use:
https://github.com/cybercatalyst/qtwebserver
It has only Qt as the only dependency, so no other libs required. Here are a bunch of examples:
https://github.com/cybercatalyst/qtwebserver-examples
This example shows you how to set up an SSL server for delivering websites over HTTPS:
https://github.com/cybercatalyst/qtwebserver-examples/tree/master/https -
Yes, I am using QSslSocket in QtWebServer.
-
@cybercatalyst Actually I intended to implement an encryption based secure socket library for using by our Qt users such as QSslSocket. The protocol has implemented and now I want to know how QSslSocket works. After that I want to mimic QSslSocket for using our encryption protocol.
-
The event loop is not needed for multi-threading, but is needed for signal and slots. You should check the documentation regarding this, but usually it involves creating a Q(Core)Application object in the main function and call the
run
function. -
I have found the problem when I implement another client/server but this time with QTcpSocket. I dont know exactly why but I guess the problem is because of using socketDescriptor for creating a QSslSocket. When I created client and server with QTcpSocket they works perfectly without any event loop and only by connecting readyRead() signal to an slot. After that in order to testing some situation I have create QTcpSocket using socketDescriptor. Then I found the problem is from creating socket using socketDescriptor because this time the readyRead() signal doesn't work as before.