SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Location
    Merseyside, UK
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XMLHttpRequest to a https URL

    Hi

    I'm currently creating a Windows Vista Sidebar Gadget using a combination of HTML, CSS, JavaScript and PHP. The Gadget updates itself based on user interaction handled by JS event handlers and XMLHttpRequests to a PHP script.

    The PHP script is work fine but it is hosted on a secure server. When I try to access it with http I dont get any content returned. If I try to access the script with https it tries to launch IE and hangs.

    When testing the PHP script in IE / FF I get a warning that the page I am trying to view has a security certificate that has not been issued by a trusted authority. I am then given the option to either continue anyway or close the webpage. Obviously if I click to continue anyway I can view the page in IE / FF. My gadget on the other hand doesn't work quite so well!

    Is there anything I can do to get around this problem in my JS?

    Any help is greatly appreciated. I've been searching all over the net all afternoon with no luck!

    Thanks

    Keith

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have encountered this once in a while with server scripts while I'm using (normally) microsoft's serverXMLHTTP object. I know that the serverXMLHTTP object has the setOption method which you can use to turn off certificate errors (google SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS)

    If you are using a client-side component such as XMLHTTPRequest I'm not sure you can do this anyway, as normally the page you are requesting must be in the same domain as the page that tries to access it using the XHR object. I don't believe that switching http/https counts as the same domain (I might be wrong).

    Can you provide more details on the objects you are using?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •