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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 15
Registered: ‎10-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: N/A
Accepted Solution

SSL Handshake Failed in BB10 QNX Momentics IDE

[ Edited ]

I'm trying to make a connection to a web service that uses SSL. I'm working with Blackberry 10 in C++ with the QNX IDE Momentics. The connection that I'm trying to do is as follows:

 

URL: "https://movilapi...."

 

Code: 

networkAccessManager = new QNetworkAccessManager(this);
    bool res = connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)),
            this, SLOT(requestFinished(QNetworkReply*)));

    Q_ASSERT(res);
    Q_UNUSED(res);

    QNetworkRequest request = QNetworkRequest(QUrl(url));
    request.setRawHeader("User-Agent", "bb-phone/20120910");
    request.setRawHeader("Content-Type", "application/json");
    request.setRawHeader("Content-Length", postDataSize);

    QSslConfiguration sslConfig = request.sslConfiguration();
    sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
    sslConfig.setProtocol(QSsl::TlsV1);
    request.setSslConfiguration(sslConfig);

        networkAccessManager->post(request, outData);

 

I'm always getting the same error no matter wich service I try to reach. The response is: SSL handshake failed

Please help, I've been searching for hours without success. Thanks.

Developer
Posts: 15
Registered: ‎10-10-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: N/A

Re: SSL Handshake Failed in BB10 QNX Momentics IDE

After getting in touch with a few RIM personal about this particular issue we found out that the TLS/SSL server is intolerant of certain extensions, so with the following Qt code to disable transmission of extensions the connection was succesfully made through https:

 

QSslConfiguration cfg(request.sslConfiguration());
cfg.setSslOption(QSsl::SslOptionDisableSessionTickets, true);
request.setSslConfiguration(cfg);

 

I want to make special mention of the Application Development department of Research In Motion for the attention and the effort invested on this issue until we finally got the right way to go.

 

Below is the entire connection code in case that anybody is facing this need:

 

networkAccessManager = new QNetworkAccessManager(this);
bool res = connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)),
            this, SLOT(requestFinished(QNetworkReply*)));    
QNetworkRequest request = QNetworkRequest(QUrl(url));
request.setRawHeader("User-Agent", "BB_PHONE/20120926");
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Content-Length", postDataSize);

QSslConfiguration sslConfig = request.sslConfiguration();
sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
sslConfig.setPeerVerifyDepth(1);
sslConfig.setProtocol(QSsl::TlsV1);
sslConfig.setSslOption(QSsl::SslOptionDisableSessionTickets, true);

request.setSslConfiguration(sslConfig);
networkAccessManager->post(request, outData);

 

 

New Developer
Posts: 4
Registered: ‎11-14-2015
My Device: blackberry z3
My Carrier: wifi

Re: SSL Handshake Failed in BB10 QNX Momentics IDE

please tell me in details what to do about this error. i do not know how to do it. how should I apply this code. whenevr I try to upload pics in whtsapp ssl handshake failed comes.please tell me how to go about this.i use a wifi connection with definite proxy..