SSL and Qt 10.2.5 for iOS

4424
1
Jump to solution
03-27-2015 02:16 PM
ChrisGoz
New Contributor

I am using the Qt Runtime SDK (10.2.5) to make an app for OS X, Android and iOS. I have also installed Esri's build of the Qt SDK for iOS (Qt540-iOS-esri.zip), and made sure the post installer is pointing to the correct qmake file.

When I try to query a secured service from my iPhone (after the map is ready), I get the dreaded "SSL handshake failed" error. The process works fine in OS X and Android, but not in iOS.

I was able to access this same service on all three platforms during the Qt 10.3 beta program.

Any ideas on how to get this working again?

Snippet of code is below.

Thanks,

Chris

code snippet:

    Button {

        text:"Get Users"

        visible: isEverythingReady

        onClicked: {

            console.log("getting data from table");

            myTable.getTheUsers();

        }

    }

    GeodatabaseFeatureServiceTable {

        id: myTable

        onQueryServiceFeaturesStatusChanged: {

            if (queryServiceFeaturesStatus === Enums.QueryFeaturesStatusCompleted) {

                try {

                    console.log("QUERY COMPLETE!!!");

                    var iterator = queryServiceFeaturesResult.iterator;

                    var featureInTable;

                    while (iterator.hasNext()) {

                        row = iterator.next();

                        console.log("field1", featureInTable.attributeValue(nameoffield1));

                        console.log("field2", featureInTable.attributeValue(nameoffield2));

                    }

                }

                catch(err) {

                    console.log("oops", err.message, err.lineNumber);

                }

            } else if (queryServiceFeaturesStatus === Enums.QueryFeaturesStatusErrored) {

                console.log("!!!! ERROR onQueryServiceFeaturesStatusChanged", queryServiceFeaturesError);

            }

        }

        function getTheUsers() {

            console.log("setting up table properties");

            var urlString = somelayerinafeatureservice;

            myTable.url = urlString;

            myTable.credentials.userName = someserfromsignin;

            myTable.credentials.password = somepwdfromsignin;

            myQuery.where = "1=1";

            myTable.queryServiceFeatures(myQuery);

        }

    }

    Query {

        id: myQuery

        returnGeometry: false

    }

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

The issue is an iOS specific issue that has to do with Qt's wrapping of OpenSSL. In order to workaround this, add the following inside of the ApplicationWindow -

Component.onCompleted:{       

     ArcGISRuntime.identityManager.ignoreSslErrors = true;

}

View solution in original post

0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor

The issue is an iOS specific issue that has to do with Qt's wrapping of OpenSSL. In order to workaround this, add the following inside of the ApplicationWindow -

Component.onCompleted:{       

     ArcGISRuntime.identityManager.ignoreSslErrors = true;

}

0 Kudos