Important: Please read the Qt Code of Conduct -

Problem With Opening https related Website

  • Hello All,

    I have a problem which is only with respect to Nokia N8 devices, Where i am using a QML Webview component for getting authenticated with a social network site.

    But in my N8 QML webview it always fires the signal onLoadFailed.

    Anybody have clues why this is happening.

  • This might be caused by a missing or invalid certificate on the N8 which causes a SSL error. Provide your own QNAM to the declarative engine which ignores or fixes SSL errors (see "QDeclarativeNetworkAccessManagerFactory":

  • Hello Lukas

    thanks a lot for your answer.

    I am not a Qt Expert so can you give me some example on how i can do that.

    or some pointers where i can start with.

    Thanks a lot

  • The QML engine uses "QNetworkAccessManager": for all network access. If "the SSL/TLS session encountered errors during the set up, including certificate verification errors" QNetworkAccessManager emits the signal "sslErrors": The slot connected to this signal may decide to "ignore the SSL error": and process on.

    The QML engine uses a "QDeclarativeNetworkAccessManagerFactory": to create a QNetworkAccessManager "on demand": By implementing your own QDeclarativeNetworkAccessManagerFactory subclass you can provide your own caching, proxy, cookie or SSL error handling implementation.

    It basically boils down to

    Make sure you have read the "QDeclarativeNetworkAccessManagerFactory details ": and see the "example":

    bq. Note that calling ["ignoreSslErrors()":] without restraint may pose a security risk for your application. Use it with care.

  • ok while waiting for your reply i digged through some documents and links then i tried something like below in my main.cpp:

    @class MyNetworkAccessManagerFactory : public QObject, public QDeclarativeNetworkAccessManagerFactory
    virtual QNetworkAccessManager *create(QObject *parent);

    public slots:
    void ignoreSSLErrors(QNetworkReply* reply,QList<QSslError> errors);

    QNetworkAccessManager* myManager;


    myManager = new QNetworkAccessManager(this);

    QNetworkAccessManager* MyNetworkAccessManagerFactory::create(QObject *parent)

    return myManager;


    void MyNetworkAccessManagerFactory::ignoreSSLErrors(QNetworkReply* reply,QList<QSslError> errors)

    int main(int argc, char *argv[])
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    MyNetworkAccessManagerFactory* myNetworkAccessManagerFactory = new  MyNetworkAccessManagerFactory();
    return app.exec&#40;&#41;;


    But while running i get an error like :
    Object::connect: No such slot QObject::ignoreSSLErrors(QNetworkReply*,QList<QSslError>)

    Now i already have a slot but why i am getting this error i dont know any help on this will be greatful.

  • Seems clear to me. The slot you are trying to connect to, does not exist.

    And, that is correct, because you forgot the Q_OBJECT macro in your class declaration. Add it, re-run qmake and recompile.

  • ok i had done that but that time i used to get a compile time error like

    bq. error: undefined reference to `vtable for MyNetworkAccessManagerFactory'

  • Add the Q_OBJECT macro and re-run qmake.

  • In addition, I'm not quite sure if it is valid to return the same QNetworkAccessManager object from subsequent calls to create() (the example does not).

  • thanks guys , i just took away the class from main.cpp into a separate header and cpp file and issue was solved.

    now i am able to load webviews with https.

  • I faced same problem when trying to connect to facebook "" with my app running in Windows. Same app worked just fine on my Mac.

    The solution above worked nicely until I added an image item in my QML. I then started to get run-time warnings "qobject cannot create children for a parent that is in a different thread". Besides the warning, the code still ran fine, but that's a scary warning, and I tried to get rid of it. This variation that returns a different NetworkAccessManager everytime a create() is requested, basically a copy of the "example": []), worked for me.

    "SSLSafeNetworkFactory::SSLSafeNetworkFactory() : QDeclarativeNetworkAccessManagerFactory()

    QNetworkAccessManager* SSLSafeNetworkFactory::create(QObject parent)
    QNetworkAccessManager * manager = new QNetworkAccessManager(parent);
    return manager;

    void SSLSafeNetworkFactory::ignoreSSLErrors(QNetworkReply* reply,QList<QSslError> errors)


Log in to reply