title: Qt QNetworkReply connection closed
body: <p>I try to execute post method in c++ to a url <code>https://...</code>, but I receive connection closed error.</p>
  
  <p>I see that my code works if I use another url like <code>https://www.google.gr</code>.</p>
  
  <p>If I remove the port <code>8181</code>  I get error: <code>server replied:not found</code>.</p>
  
  <p>My code is</p>
  
  <pre><code>static const char *REQUEST_URL="https://...";
  static const char *USER = "....";
  static const char *PASSWORD = "....";
  
  MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
      finishedexecuted=0;
      QByteArray postData;
      postData.append("username=...");
      postData.append("password= ...");
      m_network = new QNetworkAccessManager(this);
      QNetworkRequest request;
      request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
      QUrl url=QUrl(REQUEST_URL);
      request.setUrl(url);
      QSslConfiguration config = request.sslConfiguration();        
      QList&lt;QSslCertificate&gt; certs = 
                            QSslCertificate::fromPath("pistopoiitiko.crt");
      config.setCaCertificates(certs);        
      request.setSslConfiguration(config);
      QNetworkReply *reply = m_network-&gt;post(request,postData);
  
      downloadTime.start();
      QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
                       SLOT(slotSetProgress(qint64,qint64)));
      QObject::connect(m_network, SIGNAL(finished(QNetworkReply *)),
                       SLOT(slotRequestFinished(QNetworkReply *)));
  
      connect(m_network, 
              SIGNAL(sslErrors(QNetworkReply *, const QList&lt;QSslError&gt; &amp;)),
              this, 
              SLOT(sslError(QNetworkReply*, const QList&lt;QSslError&gt; &amp;)));
      } 
  
  void MainWindow::sslError(QNetworkReply* reply, 
                             const QList&lt;QSslError&gt; &amp;errors )
  {...}
  
  void MainWindow::slotRequestFinished(QNetworkReply *reply)
  {
   ...
      if (reply-&gt;error() &gt; 0) {
      m_label-&gt;setText("Error number = " + reply-&gt;errorString());
     }
   ...
  }
  
  void MainWindow::slotSetProgress(qint64 received, qint64 total)
  {...}
  </code></pre>
  
  <p>Any ideas?</p>