Error: Protocol "https" is unknown
-
@Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.
Error is: Use of undeclared identifier QSslSocket
This post is deleted! -
@Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.
Error is: Use of undeclared identifier QSslSocket
@jabille said in Error: Protocol "https" is unknown:
@Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.
Error is: Use of undeclared identifier QSslSocket
As silly as it may sound: did you include the proper header ?
-
@jabille said in Error: Protocol "https" is unknown:
@Ronel_qtmaster @SGaist I don't think QSslSocket::supportsSsl() is supported in Qt 5.2.1. I am getting an error on this line.
Error is: Use of undeclared identifier QSslSocket
As silly as it may sound: did you include the proper header ?
-
@SGaist Yes. I #include <QSslSocket> and it the code is building properly on my Qt 6.7.3 Kit (Windows) but not on my Qt 5.2.1 Kit (Generates package installed to Linux device).
@jabille QSslSocket is available since Qt 4.3.
Do you haveQT += network
in your pro file?
How did you install Qt 5.2.1? Maybe network module is missing in this Qt installation? -
Lifetime Qt Championwrote on 6 Nov 2024, 06:47 last edited by SGaist 11 Jun 2024, 06:48
Beside the question from @jsulm, are you sure that version of Qt was built with OpenSSL support ?
-
wrote on 6 Nov 2024, 07:11 last edited by
Yes, I also have QT += network. I can confirm that network module is there.
I am able to get a proper response for a QNetworkRequest in 5.2.1 but only in http. If I set the url to https, I get the error: Protocol https is unknown. QNetworkAccessManager supportedSchemes() also does not list https.How do I check if it has OpenSSL support other than QSslSocket::supportsSsl()? The thing is that the qt5.2.1-arm-linux came from the device vendor. It is included in their SDK. So, they might be some things that are missing.
Also, sorry if I am replying to both of you at once. I can only post every 600 seconds as a newbie here.
-
You have the answer: the class is not available so it was not built with OpenSSL support.
You have to check with your vendor.
On that note, seeing the version of Qt, the versions of OpenSSL supported at that time are also now obsolete so I would highly recommend considering porting to a more recent version of Qt.
-
You have the answer: the class is not available so it was not built with OpenSSL support.
You have to check with your vendor.
On that note, seeing the version of Qt, the versions of OpenSSL supported at that time are also now obsolete so I would highly recommend considering porting to a more recent version of Qt.
wrote on 6 Nov 2024, 07:46 last edited by@SGaist I see. I'll talk to the vendor regarding this.
When I tried to copy the path of the #include <QSslSocket>, I can see that it is in the C:\NPT_SDK\Linux\Core\third-party\qt5.2.1-arm-linux\include\QtNetwork and inside qsslsocket.h there is a flag QT_NO_SSL. Maybe that is why it is disabled? I have no clue how that is set or where it's from. -
wrote on 6 Nov 2024, 07:48 last edited by
Also, to verify that your SSL works, you can try to compile and run the Secure Socket Client example app in Qt 5.2.1
-
@SGaist I see. I'll talk to the vendor regarding this.
When I tried to copy the path of the #include <QSslSocket>, I can see that it is in the C:\NPT_SDK\Linux\Core\third-party\qt5.2.1-arm-linux\include\QtNetwork and inside qsslsocket.h there is a flag QT_NO_SSL. Maybe that is why it is disabled? I have no clue how that is set or where it's from.@jabille said in Error: Protocol "https" is unknown:
Maybe that is why it is disabled?
No, it is there because Qt was built without SSL support. You need a Qt build with SSL support.
14/14