SSL handshake failed in the BB10 QNX Momentics IDE

I am trying to connect to a web service that uses the SSL protocol. I work with Blackberry 10 in C++ with the QNX Momentics IDE of. The connection that I am doing is this:

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 still get the same error, regardless of the service which I try to reach. The answer is: SSL handshake failed

Please help, I have searched for hours without success. Thank you.

After getting in contact with the RIM a little personal on this issue, we discovered that the TLS/SSL server does not tolerate some extensions, so with the following code of Qt to turn off extensions, the connection was properly made over https:

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

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

Here is the code to connect to the case wherever everyone faces 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);

Tags: BlackBerry Developers

Similar Questions

  • Pretty print Qt containers when debugging QNX Momentics IDE

    Hi all

    I wonder if anyone knows how to display the containers in a human readable way under debugging Qt?

    So, IE if I str ("hello") QString under debug I want to see 'Hello' as the value of str instead of lots of pointers

    Thank you

    Philippe

    Yes, you can have the debugger QNX Momentics IDE show the string in the window of variables properly.

    Directions for use:

    Window-> Preferences-> C / C++-> debug-> GDB and make sure that "pretty printing" is enabled

    Make a file called .gdbinit in the folder root of your project and put this:

    Python
    import sys
    sys. Path.Insert (0, '.')
    of qt4 import register_qt4_printers
    register_qt4_printers (no)
    end

    Then copy the qt4.py file from: https://projects.kde.org/projects/extragear/kdevelop/kdevelop/repository/revisions/master/changes/de...

    Place this file in the same working directory (the directory of the project).  Or you can put somewhere else and replace the "." in "sys.path.insert (0, '.').  with the folder that contains the qt4.py

    Next time you run the debugger, it should show the QString.

    If you have any problems (it does not), you can see the gdb trace console and the gdb console (try: source .gdbinit) to see the errors.

    I still have to do with the dinkum STL.   I just started...  PM me if you want that the instructions once I'm done...

    p.s. Thanks to the kdevelop team who made this python module.

    Edit: removed game print pretty line in .gdbinit.  correctly implemented by the ide from qnx.

  • Build the project fails on QNX momentics IDE

    Software: Native SDK 2.0 beta3 QNX momentics IDE

    Problem: after press build project, no file bar.

    Have tried these methods:
    a.Restart pc and playbook on failure
    b on blackberry desktop software fail
    invalid c.Check os version
    d.REINSTALL blackberry sdk native-beta3 fail

    Does anyone know how to solve the problem?

    Thank you for your attention.

    Generation of a project does not generate a BAR file.

    Launch (run or debug) an application generates a BAR file development mode.

    Export Release Build Wizard generates an output mode BAR file.

    HTH,

    Christian

  • QNX Momentics IDE connection to the server at startup?

    Whenever I run my QNX Momentics IDE it try to connect to a server on port 4455. Anyone know what it is? It doesn't seem to be only a COMPLETE domain name attached to the IP address that is what worries me.

    Native development kit, reaching out to the targets of BlackBerry (PlayBook, Dev Alpha or Simulator), you have set up to see if they are available.

  • Need help to add the libcurl library in QNX momentics IDE

    Hello

    I am new to the native SDK development for Tablet OS, I'm working on an application that were a part of the user interface, we need to manage the HTTP connections and also need to run in the background.

    I tried, but was unable to download the library libcurl to handle HTTP connections. Can someone give me the link to download the file to library for QNX momentics IDE and a source code example of the use of this library for manipulation of HTTP requests analysis JSON ?

    Also, I need to find a way to run my application in the background. So I'm looking for something to do.

    Thanks in advance .

    libcurl is integrated in the NDK. Simply import the headers in the file "curl" such as . Be sure to refer to the library (curl) in your project.

  • If register with RIM signing do not work correctly in QNX Momentics IDE®

    Hello

    I reveiced files of the SJC. ® For QNX Momentics IDE, I open the preferences-> BlackBerry Tablet OS-> signature - > save.

    I complete the form with the SJC, pine files and passwords. When I submit the form, everything is ok and I receive an email to confirm that I am registered.

    But the problem is when I restart QNX Momentics IDE®, BlackBerry Tablet OS->-> RIM signing authority signature it says "saved: No.

    If I try to record again, QNX Momentics IDE® say that I'me is already registered, and I need to contact RIM to add another user (I don't want to add another user).

    Someone had the same problem? How to fix this?

    Best regards

    System Specs:

    Windows 7 32 bit under parallels on Mac OS x 10.6.8 6.0.12090

    ® For QNX Momentics IDE for BlackBerry® native SDK for Tablet OS Version: 1.0.0 Build id: 201110112127

    There is a bug in NDK 1.0 with localized Windows versions and the signature. This bug has been fixed in NDK 2.0, which should be published very soon. You can also use the beta version 3 If you can't wait for the release of the NDK 2.0 GA.

    Unfortunately, you will need to ask new SJC files and resave.

  • Clean install QNX Momentics IDE but no. SDK can be found.

    I unstall the old version, delete the folder and install the QNX Momentics IDE in the default directory;

    When I try to create a workspce, it appears without SDK is located. Install a software development kit to enable the QNX Momentics features.

    Anyone has the same problem?

    Found the problem

    in the windows--> the Blackberry SDK native short cut tap

    C:\bbndk\ide\win32\x86\eclipse\qde.exe

    To take

    C:\bbndk\bbndk.bat (bbndk_admin.bat)

    Then the problem is resolved.

  • QNX Momentics IDE design mode

    Hi people - I just started development in QNX Momentics IDE and I, no matter what I try, doesn't happen in "design" mode  It is disabled, even when training following the exact steps in the video tutorials on web Blackberry based on. Are there cases where the IDE would be denied the opportunity to 'design' when you view a QML file?

    Check the settings of the editor on BlackBerry/QML, uncheck the box "disable", re - open a qml file. It must run the compatibility check.

  • SSL handshake failed: unsupported OIDS in the AlgorithmIdentifier

    Hello

    Anyone know how I can fix this error when a certificates to access java webservice client in the trust keystore? I use jdk6...

    < 14 - may - 2015 13H 16' it IS > < opinion > < security > < BEA-090898 > < without taking account of the approved CA ' CN = VeriSign universal Root Certification Authority, OR = (c) 2008 VeriSign\, Inc. - For authorized use only, OU = VeriSign Trust Network, O = VeriSign\, Inc., C = US ". Loading certificate trust list triggered a certificate of analysis exception PKIX: OID not supported in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11. >

    I read these posts. I tried the update of policy and also tried running with jdk8:

    http://blog.whitehorses.nl/2013/12/12/BEA-090898-unsupported-OID-in-the-AlgorithmIdentifier-object/

    http://www.Ateam-Oracle.com/improve-SSL-support-for-your-WebLogic-domains/


    Any idea?

    Thank you very much

    Thank you! It's true... I think my java webservice client using weblogic libraries, JDeveloper it create this way...

    I tried with this properties and now loading properly secure certificates:

    -Dweblogic.security.SSL.enableJSSE = true

    -Dweblogic.ssl.JSSEEnabled = true

    Thank you very much

  • Display of newspapers without QNX Momentics IDE

    Hello world!

    I switched to QT Creator for faster compilation & deployment.

    Everything works including fines of debugging, but it displays no newspapers (qDebug etc.).

    I know that newspapers should be directed to stdout/stderr if they should be displayed in the console of QNX Momentics.

    This is done using qInstallMsgHandler and it works. But it does not work in QT Creator.

    So the question is:

    How QNX Momentics intercepts not newspapers once they are redirected to stderr/stdout?

    I was able to view the logs via SSH using the following method. He works for slogger2, but I don't know how to access the output stdout/stderr:

    (1) start blackberry connect

    / Applications/bbndk/host_10_0_9_52/darwin / x 86/usr/bin/blackberry-connect 192.168.157.128 - password devicePass - sshPublicKey «/Users/User/.config/QtProject/qtcreator/qnx/BlackBerry Simulator/id_rsa.pub»

    (2) ssh [email protected] "/Users/User/.config/QtProject/qtcreator/qnx/BlackBerry Simulator/id_rsa.

    (3) slog2info w | grep qt - msg

    All suggestions are welcome!

    He can't not stunts.

    I followed this guide:

    http://Qt-project.org/wiki/Qt-creator-with-BlackBerry-10

    Automatic completion did not work initially. I don't know why, maybe the roads were too long?

    As a solution, I created a symbolic link in the my project folder:

    include->/Applications/bbndk/target_10_0_9_386/qnx6/usr/include

    Then I added the following lines to the .pro file:

    INCLUDEPATH += include include/qt4/QtCore
    LIBS += -lbbcascades
    

    In addition, newspapers started working after restart.

    Everything works now.

    p.s. I use Mac OS X Lion.

  • Printing on console in QNX Momentics IDE?

    How can I actually go about printing to the console of one of my cpp files?  All I'm doing is printing data, so that I know what I'm working with and then proceed accordingly.

    When working on Android apps in Eclipse, all I had to do was type System.out.println (); and fill it with any object or variable and it would spit out.  I can't find something similar here.

    Thanks in advance!

    qDebug() and similar forms of output should go to the output of "slog2" for the application, which wrote a special area of RAM disk file wherever it is controllable Momentics using some feature view log (you'll have to google or search the Forum... I don't use it) or by connecting to the device with SSH and using 'slog2info w' or a similar form of this command.

    An output is not redirected it should end by in the output/log logs file, which is written in the actual flash file system and thus a target less desirable slog2 and you can also view that via the IDE or via SSH, in this case using the 'cat', or even 'tail-f newspaper/Journal"only after changing the directory current for sandbox of your app folder.

  • "Could not connect to internet" Blackberry SDK (QNX Momentics IDE)

    Hello

    I'm looking to do a development of blackberry, but I can't get the SDK to update.  I get the message "Could not connect to" internet on the canvas when I start the SDK

    I checked my firewall settings and I added manually to the qde.exe in the exceptions, but still no luck.  Has anyone encountered this before? I tried to go to: help-> update API levels and I get: "cannot download SDK information."  When I checked the error log, I noticed this message: java.net.ConnectException: Connection timed out: connect

    My OS:

    Windows 7 - Service Pack 1

    8 GB Ram

    I had to enter the proxy information in the Preferences tab (Window - Preferences, then general-> network connections).  After you restart the SDK it worked!

  • Problem with compiling under QNX Momentics IDE

    Hello! I developed a small application based on Qt for BlackBerry Playbook.

    When I try to build my app in debug mode of Simulator, NDK error reports:

    CC: cannot specify - P, - C, - E, - c or S - with o and multiple files

    How can I fix this error?

    You do not have a typing error:

    -DQ_MOC_OUTPUT_REVISION = 63
    

    If it should not be:

    -DQ_MOC_OUTPUT_REVISION=63
    
  • Between R2 2012 Windows and IBM Http Server SSL connection failed periodically.

    Hi, I have a problem recently. I found that my windows server 2012 R2 has sometimes failed to connect with IBM Http Server ssl. Here it is the information of the two servers:

    1 windows 2012 R2

    -Already activate TLS 1.2 and TLS 1.0

    -Already the latest version of windows update and restart

    IIS - 8.5

    2 IBM Http Server

    -Apache 2.2.31

    -using OpenSSL 1.0.2f

    -Allow TLS1.2 and TLS 1.0

    I also captured network traffic when the two server. If the ssl connection has managed to create. Traffic will be like the following screen:

    If the ssl connection was impossible to create, network traffic was like the below:

    You will see that the ssl connection failed when the version of the TLS protocol was passed to TLSv1. And returned access denied.  The details of the access denied was like the below:

    As the captured screen reproduced above, you will see that the SSL for Client Hello was TLSv1.2 but running on the recording layer TLSv1. this Hello customer was sent by the server r2 windows 2012. I don't know why the ssl connection has been passed to TLSv1 suddenly.

    I found that Microsoft has released an update on January 12, 2016. This fix is the resumption of SSL. Update ID was 3109853 , but I have already applied this update on my server. I tried to do the with the other type of server ssl connection, the ssl connection is possible in a stable condition and has happened the problem I mentioned. Is there someone met this case and resolve it finally?

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • Porting Qt for Qnx Momentics application

    Hey, I wanted to know if its possible to transfer my Qt to the Qnx Momentics IDE application. I search everywhere to search to find the documentation or instuctions on how but cannot find information porting of Qt Creator

    Basically, that's what I

    I carried the Qt for Qt Creator application and have successfully got running on the Alpha of Dev

    Now I want to:

    1 import / move more Qt App to the IDE from Qnx

    2. remove the Qt INTERFACE and rebuild the App for UI in the cascades while keeping the back end qt

    So can I keep the rear end of Qt and rebuild this Interface in waterfalls?

    If for anoyone can point me to the documentation on how I can move the porject in Qnx Momentics.

    NOTE: Im fully aware im not able to mix code UI/Interface Qt with waterfalls. I have to choose one or the other. in this case, I want to replace the user of Qt interface with waterfalls

    Thanks in adavnce, happy coding and porting

    Yes, QDE is QNX Momentics IDE. I think it is easier to move their inverse:

    Create a new project in Momentics, and then move the source one of the old project files in new (with the exception of the classes related to the GUI). And then recreate the GUI.

    On QT Creator / waterfalls:

    To set up QT Creator, follow the steps on the wiki:

    http://Qt-project.org/wiki/setting-up-Qt-Creator-for-BlackBerry-and-QNX

    I think you have already done this.

    Then create a Qt Quick project (wiki describes this step).

    After that remove all Qt Quick related features of the project and add libraries of stunts in the .pro file. This is how my project file looks like this:

    TEMPLATE = app
    
    # Please do not modify the following line.
    #include(qmlapplicationviewer/qmlapplicationviewer.pri)
    
    # Additional import path used to resolve QML modules in Creator's code model
    QML_IMPORT_PATH =
    
    QT += declarative script xmlpatterns xml sql network svg
    
    INCLUDEPATH += src
    
    # Workaround for autocompletion bug
    INCLUDEPATH += include include/cpp include/qt4/QtCore include/qt4/QtSql include/qt4/QtNetwork
    
    LIBS += -lbbcascades -lbbcascadesmultimedia -lbbdevice -lbbplatform -lbbpim -lbbdata -lbbcascadespickers -lbbsystem -lbbmultimedia
    
    # The .cpp file which was generated for your project. Feel free to hack it.
    SOURCES += main.cpp \
       ...other cpp files...
    
    OTHER_FILES += bar-descriptor.xml \
        qml/main.qml
    
    HEADERS += \
       ...header files...
    

    Then update file bar - descriptor.xml. You can use the Momentics generated file as a template. Here's my bar - descriptor.xml (replace application_name and paths):

    
    http://www.qnx.com/schemas/application/1.0">
        com.mydomain
        Application Name
        1.0.0
        Application Description
        
            none
            false
            true
            portrait
        
        
        
        
        run_native
        MyApplication
        qml
        assets
        
            assets/images/icons/applicationIcon114.png
        
        
           assets/images/splash/portrait768x1280.jpg
           assets/images/splash/portrait720x1280.jpg
        
    
    

    After this attempt to create and deploy a simple project of Cascades. If everything is ok, start moving your old project files (file-by-file).

    Important:

    AutoComplete does not work initially. All stunts and Qt classes will be highlighted in red.

    Wiki describes some workaround solutions. The one I use is create a symbolic link in your project file to point to the ndk includes the folder:

    lrwxr-xr-x @ staff 1 user 55 15 Dec 19:23 include->/Applications/bbndk/target_10_0_9_1673/qnx6/usr/include

    Then, add the following line to the .pro file:

    INCLUDEPATH += include include/cpp include/qt4/QtCore include/qt4/QtSql include/qt4/QtNetwork
    

    Autocompletion should work after that. I use Qt Creator on MacOS, this may not apply to the version of Windows.

Maybe you are looking for

  • Is there an easy way to replace individual items in an array of strings to another table of striing?

    I have an array of strings with elements as follows: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5TH 00 00 00 00 00 50 00 30 00 33 00 34 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 The table I want to use to r

  • Error 0 x 80070005 backup on external hard drive

    I tried several times to make a backup of my laptop on a hard drive external, a WD 1 TB hard drive and continue to receive the error code: 0x80070005. I have not found this error code in the Knowelege Base. What causes this error & what can be done t

  • How can I get a copy of MS Works on my new computer

    I bought a new computer and I was wondering if it is possible to get MS Works is installed. I have it on my old computer and I used a lot and I wish I had on my new computer. I did some research and everything that comes is office, I do not use and d

  • sending photos by email win 8

    HI I have upgraded to a full version of win 8 of the preview version. In the old version I click with the right button on a photo and send to mail recipient and outside, he would go. With the new version when I do this it tells me to go to default pr

  • The last Photoshop 2015.5, filters lost load

    I loaded the last Photoshop Cloud 2015.5 and lost my "Topaz" and SilverEFex filters. Reinstalled the programs but they still do not appear in the drop-down filter? No error message.