[solved] SSL handshake failed : on downloadin image.



  • I am doing this and getting SSL handshake failed : on downloadin image.

     QNetworkRequest request;
                    request.setUrl(QUrl(fileURL));
                    QNetworkAccessManager *downloadmanager = new QNetworkAccessManager(this);
                    downloadreply = downloadmanager->get(request);
                    file = new QFile;
                    file->setFileName(saveFilePath);
                    file->open(QIODevice::ReadWrite);
             
                    connect(downloadreply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(onDownloadProgress(qint64,qint64)));
                    connect(downloadmanager,SIGNAL(finished(QNetworkReply*)),this,SLOT(onFinished(QNetworkReply*)));
                    connect(downloadreply,SIGNAL(readyRead()),this,SLOT(onReadyRead()));
                    connect(downloadreply,SIGNAL(finished()),this,SLOT(onReplyFinished()));
                    connect(downloadreply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(slotErrorCover(QNetworkReply::NetworkError)));](link url)
    

    and this

    void DiscogsApi::slotErrorCover(QNetworkReply::NetworkError error)
    {
         qDebug() << "Network Error Code: " << error;
         qDebug() << " ErrorString :-"<< downloadreply->errorString();
    }
    

    Application Out Put :
    Network Error Code: 6
    ErrorString :- "SSL handshake failed"


  • Moderators

    @vivekmalik2466 The new forum uses Markdown language for editor. Use ``` (3 backticks) for code blocks.



  • After doing this my error get solved .

    [ QNetworkRequest request;
    request.setUrl(QUrl(fileURL));
    QNetworkAccessManager downloadmanager = new QNetworkAccessManager(this);
    QSslConfiguration sslConfiguration = request.sslConfiguration();
    sslConfiguration.setProtocol(QSsl::AnyProtocol);
    sslConfiguration.setPeerVerifyMode(QSslSocket::QueryPeer);
    request.setSslConfiguration(sslConfiguration);
    downloadreply = downloadmanager->get(request);
    file = new QFile;
    file->setFileName(saveFilePath);
    file->open(QIODevice::ReadWrite);
    connect(downloadreply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(onDownloadProgress(qint64,qint64)));
    connect(downloadmanager,SIGNAL(finished(QNetworkReply
    )),this,SLOT(onFinished(QNetworkReply*)));
    connect(downloadreply,SIGNAL(readyRead()),this,SLOT(onReadyRead()));
    connect(downloadreply,SIGNAL(finished()),this,SLOT(onReplyFinished()));
    connect(downloadreply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(slotErrorCover(QNetworkReply::NetworkError)));](link url)



  • For windows we had to add dependent file to setup release folder ssleay32.dll and libeay32.dll .


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.