Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt QNetworkAccessManager with SSL

Tags:

ssl

connection

qt

i'm completely new to SSL (and newbee to Qt, too). I want to create a SSL encrypted connection and haven't found any good examples concerning the general structure.

QNetworkAccessManager qnam;
QSslConfiguration sslConfiguration(QSslConfiguration::defaultConfiguration());
SslConfiguration.setProtocol(QSsl::SslV3);
QNetworkRequest req;
req.setSslConfiguration(sslConfiguration);
req.setUrl(QUrl("https://www.address.tld/"));

QNetworkReply *rep = qnam->get(req);

is this how it works or do i have to do anything further?

greetings

like image 253
user2998780 Avatar asked Nov 12 '22 18:11

user2998780


1 Answers

It's possible that you asked this question at a time when there were no examples that you could follow. At the moment there are several examples. Go to the Welcome page in QT Creator and select Examples (under the Projects button in the left pane.) Then type "ssl" into the search box. On my system I see three examples. HTH.

like image 184
Sam Azer Avatar answered Nov 15 '22 10:11

Sam Azer