HoloLens: RicHoloLensRestClient now has an explicit setter for disabling SSL certificate verification. Removed separate flag for controlling whether debug export to file will be done. Now does the export whenever a folder is specified.

This commit is contained in:
sigurdp
2019-01-15 13:23:12 +01:00
parent 9cbbde3f74
commit 469437f320
4 changed files with 34 additions and 23 deletions

View File

@@ -18,9 +18,6 @@
#include "RicHoloLensRestClient.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "cvfBase.h"
#include "cvfTrace.h"
@@ -54,7 +51,8 @@
RicHoloLensRestClient::RicHoloLensRestClient(QString serverUrl, QString sessionName, RicHoloLensRestResponseHandler* responseHandler)
: m_serverUrl(serverUrl),
m_sessionName(sessionName),
m_responseHandler(responseHandler)
m_responseHandler(responseHandler),
m_dbgDisableCertificateVerification(false)
{
}
@@ -66,6 +64,14 @@ void RicHoloLensRestClient::clearResponseHandler()
m_responseHandler = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHoloLensRestClient::dbgDisableCertificateVerification()
{
m_dbgDisableCertificateVerification = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -84,14 +90,13 @@ void RicHoloLensRestClient::createSession(const QByteArray& sessionPinCode)
// NOTE !!!
// Apparently something like this is currently needed in order to get SSL/HTTPS going
// Still, can't quite figure it out since it appears to be sufficient to do this on the first request
// This will have to be investigated further, SP 20181924
// This will have to be investigated further, SP 20180924
QSslConfiguration sslConf = request.sslConfiguration();
// Needed this one to be able to connect to sharing server
sslConf.setProtocol(QSsl::AnyProtocol);
bool disableCertificateVerification = RiaApplication::instance()->preferences()->holoLensDisableCertificateVerification();
if (disableCertificateVerification)
if (m_dbgDisableCertificateVerification)
{
sslConf.setPeerVerifyMode(QSslSocket::VerifyNone);
}