1 Reply Latest reply on Aug 12, 2008 9:00 AM by Chris_Alexander

    URLRequest with HTTPS and Basic Authorisation

    Chris_Alexander
      I am using AIR with HTML and Javascript; I am using code obtained from the AIR documentation and I am getting behaviour I cannot explain!

      I am attempting to interact with an online API; it requires basic authentication for each post, but it uses SSL security so has an https:// address.

      This is an example of the code I'm using:

      function getMessage() {
      var request = new air.URLRequest("https://url");
      air.URLRequestDefaults.setLoginCredentialsForHost("domain", "user, "pass");
      var loader = new air.URLLoader();
      loader.addEventListener(air.Event.COMPLETE, completeHandler);
      loader.load(request);
      function completeHandler(event)
      {
      var dataXML = event.target.data;
      air.trace(dataXML);
      }
      }

      The error I recieve is:

      Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: https://url
      at flash.html::HTMLLoader/nativeOnMouseUp()
      at flash.html::HTMLLoader/invokeMouseUpImpl()
      at flash.html::HTMLLoader/onLeftMouseUp()

      When I use a http:// address that requires Basic authentication it works properly, and when I access a https:// url that doesn't require authentication it also manages to access the appropriate data.

      I have tested the URL I am trying to access (the https with basic auth) and it works perfectly fine, so I am wondering if it is an issue I'm not seeing with AIR. Any help would be greatly appreciated :-)

      Chris Alexander