1 Reply Latest reply on Oct 31, 2013 8:28 AM by Anton Vishnevsky

    WP8 emulator will not connect to web service using https

    Dave Philips



      I have a simple mobile app that tries to connect to a remote web service to authenticate a user.


      The code I use to contact the web service is as follows:


      url = "https://my.web.server/WebService1/Service.asmx/ValidateUser"
      body = {"username" => @params['login'], "password" => @params['password']}.to_json
       :url => url,
       :headers => {"Content-Type" => "application/json", "Content-Length" => body.length},
       :body => body,
       :callback => url_for(:action => :login_callback),
       :ssl_verify_peer => false)


      The web service is on a server that has an ssl certificate issued by Digicert, which appears in the list of supported CA's.




      When I run the application in the WP8 emulator, I get a pause of about 3 or 4 seconds, then am returned the following:


      {"rho_callback"=>"1", "body"=>"", "error_code"=>"1", "status"=>"error", "headers"=>{"Content-Length"=>"47", "Content-Type"=>"application/json", "User-Agent"=>"Mozilla-5.0 (WP8; ; )"}}


      If I connect using http instead then everything works, so it's obviously the https that's causing the problem.


      I can connect to the web service using https via the browser on the WP8 emulator without a problem, so its something to do with the application itself.


      Any ideas as to what the problem could be would be greatly appreciated.