AnsweredAssumed Answered

Certificate Error when using WebAPI Calls on IIS Express

Question asked by jramirez on Feb 27, 2016
Latest reply on Mar 2, 2016 by jramirez

Hi:

I am working on a Web API application, here is the issue:

When debugging in VS2012 the URL is http://localhost:58214/index.html, the server is the IIS express server.

I am getting a data.status=0 when sending the authorization credentials to the server (see code below) and any webapi calls do not work at all.however when I open Fiddler and try to login again using webapi I get a pop up window with a "Certificate Error" title, and asking for "ignore errors (unsafe) an proceed" if I choose to ignore then then everything works fine as long as fiddler is open.

 

Any ideas?

 

Jaime

 

 

var authSuccessCallBack = function (data, statusMessage, statusObj) {

    alert("Log OK");

};

 

 

var authErrorCallBack = function (data) {

    if (data.status == 401) {

        alert("Invalid username and password.");

    }

    else {

        alert("Error during validation.");

    }

};

 

    //TEST START HERE

 

 

    $("#Test-btn").click(function () {

        var username = "Administrator";

        var password = "Sios10";

 

 

        piwebapi.SetBaseUrl(baseServiceUrl);

        piwebapi.SetCredentials(username, password);

        piwebapi.Authorize(authSuccessCallBack, authErrorCallBack);

    });

Outcomes