Hello, I am new to QT5 and I am having some trouble with QNetworkAccessManager. I need to create a login form that uses HTTPS but when I make a request I get

Qt Code:
  1. qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
To copy to clipboard, switch view to plain text mode 

Here is my code inside mainwindow.cpp:

Qt Code:
  1. QUrl loginUrl = QUrl("https://172.30.254.30/api/login");
  2.  
  3. QUrlQuery postData;
  4. postData.addQueryItem("email",email);
  5. postData.addQueryItem("password",password);
  6.  
  7. qInfo() << email << " " << password;
  8.  
  9. QNetworkAccessManager *netManager = new QNetworkAccessManager(this);
  10.  
  11. connect(netManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(sslFix(QNetworkReply*)));
  12. connect(netManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
  13.  
  14. QNetworkRequest request(loginUrl);
  15. request.setHeader(QNetworkRequest::ContentTypeHeader,
  16. "application/x-www-form-urlencoded");
  17.  
  18. netManager->post(request, postData.toString(QUrl::FullyEncoded).toUtf8());
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void MainWindow::requestFinished(QNetworkReply *response) {
  2. QByteArray res = response->readAll();
  3. qInfo() << "Raw: " << res;
  4. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void MainWindow::sslFix(QNetworkReply *request){
  2. request->ignoreSslErrors();
  3. }
To copy to clipboard, switch view to plain text mode 

Any help would be great!

Thanks,

James