Hololens 2 Send Device Portal Commands with MRTK Failing

Copper Contributor

I'm trying to use the MRTK Device Portal API to send commands to a local Hololens 2. I am exploring this functionality with the RESET command, eventually I'd like to use a POST command to launch an application. This is on a LAN router than I can connect to using local Photon connection.

    public async void ResetButtonPress()
        var headers = new Dictionary<string, string>();
        authenticationReturn = Microsoft.MixedReality.Toolkit.Utilities.Rest.GetBasicAuthentication("USERNAME", "PASSWORD");
        string query = "http://10.88.xxx.xx/api/control/restart";
        headers.Add("Authorization", authenticationReturn);
        deviceResponse = await Microsoft.MixedReality.Toolkit.Utilities.Rest.PostAsync(query, headers);
        connected.isOn = deviceResponse.Successful;
        display.text = deviceResponse.ResponseBody;

I'm receiving the error: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED from the deviceResponse line.

My project uses MRTK 2.7.0. I've used Fiddler to isolate the successful commands on the Web Device Portal to confirm that the authentication code I'm passing is correct. The Hololens 2 I'm using is up-to-date on software. I've tried adding additional header information based on what I've pulled from Fiddler to no avail as well.

What am I doing wrong here?

2 Replies