Hi Folks,
I’m trying to get harmony to talk to shot managers like Shotgun or Kitsu through restAPI.
So far I’ve been able to get data from the API using http, but when I try getting data securly through https I keep getting SSL errors.
Heres my code so far. (I removed all the curly brackets because the forum does not like them).
function doRequest()
var url = new QUrl(‘https://jsonplaceholder.typicode.com/todos/1’);
var request = new QNetworkRequest(url);
var nam = new QNetworkAccessManager();
nam.finished.connect(handleResponse);
nam.get(request);
function handleResponse(reply)
MessageLog.trace(reply);
var error = reply.error(QNetworkReply.NetworkError);
if (error == QNetworkReply.NoError)
var bytes_string = reply.readAll();
MessageLog.trace(bytes_string, ‘utf-8’);
else
MessageLog.trace("Error occured: ", error);
MessageLog.trace(reply.errorString());
doRequest();
If the script is run with http it works fine but with https it fails.
I’ve tried using QSslConfiguration to ignore the certificate error but Harmony’s debugger keeps saying its undefined.
Here’s one example I’ve tried.
var sslConfig = reply.sslConfiguration();
var sslConfig = new QSslSocket.sslConfiguration();
sslConfig.setPeerVerifyMode(QSslSocket.VerifyNone);
reply.setSslConfiguration(sslConfig);
But this is also bugging out with undefined errors.
If someone on the Harmony team could please take a look and let me know what’s going on that would be a huge help.