Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 30
Registered: ‎11-02-2010
My Device: playbook

QSslSocket return invalid url

I am desperately trying to set QSslSocket connection, I try to start from blackberry sample but always get an Invalid URL error on my console without any details... Here is the code I try to run:

if(!m_socket){bool res;
     Q_UNUSED(res);
    m_socket =newQSslSocket();// Connect to signals to receive notifications// about state changes

    res =QObject::connect(m_socket,
                SIGNAL(sslErrors(QList<QSslError>)),this,
                SLOT(onSslErrors(QList<QSslError>)));

    Q_ASSERT(res);

    res =QObject::connect(m_socket,
            SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,
            SLOT(onSocketSateChange(QAbstractSocket::SocketState)));
    Q_ASSERT(res);

    res =QObject::connect(m_socket,
                    SIGNAL(error (QAbstractSocket::SocketError)),this,
                    SLOT(onError(QAbstractSocket::SocketError)));
            Q_ASSERT(res);

    res =QObject::connect(m_socket, SIGNAL(encrypted()),this,
            SLOT(onSocketEncrypted()));
    Q_ASSERT(res);

    res =QObject::connect(m_socket, SIGNAL(readyRead()),this,
            SLOT(onSocketReadyRead()));
    Q_ASSERT(res);}// Make the SSL connection to the host on the specified port
m_socket->connectToHostEncrypted("www.blackberry.com",443);/* if (!m_socket->waitForEncrypted()) {
    qDebug() << m_socket->errorString();
    //return 1;
}
 */}

If anyone can help or show me an ssl sample working...

Developer
Posts: 263
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: QSslSocket return invalid url

I got the same issue, how did you solve this?
--tom