Thread: SSL with QML
View Single Post
Posts: 324 | Thanked: 371 times | Joined on Dec 2009 @ Vancouver, BC
#1
Has anyone been successful in fetching an SSL page using XmlHttpRequest in QML on N900? I've got the following bit of code, which works fine for non-SSL page, but the response for SSL pages is empty (status code of 0, and empty headers). It works fine on the desktop and the N8. Am I missing something on the N900, or a bug on that platform?

Code:
import Qt 4.7

Rectangle {
    width: 360
    height: 360
    id: screen
    property string addText: ""

    Text {
        id: textDisplay
        anchors.centerIn: parent
        text: "Status code: " + parent.addText
    }

    Component.onCompleted: {
                var url = 'https://maemo.org/'
                var xhr = new XMLHttpRequest;
                xhr.open("GET", url);
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == XMLHttpRequest.DONE) {
                        screen.addText = xhr.status
                    }
                }
                xhr.send();
    }
}