SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation IServerXMLHTTPRequest on HTTPS

    I am trying to implement a c++ application that will access an HTTPS server using IServerXMLHTTPRequest.

    When I try to run the code below, the server returns an 403 (Forbidden) error.

    What could be the cause of this? And, what should I do about this?

    My current code is:

    Code:
        CComPtr<MSXML2::IServerXMLHTTPRequest> xmlHttp;
        HRESULT hr = xmlHttp.CoCreateInstance(__uuidof(ServerXMLHTTP));
        hr = xmlHttp->open(_T("POST"),_T("https://someurl.com/somepath"),false);
        hr = xmlHttp->setTimeouts( 100000,
                50000,
                100000,
                100000
                );
        hr = xmlHttp->setOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT,
                                xmlHttp->getOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT));
        hr = xmlHttp->setRequestHeader(_T("Content-Type"),_T("application/x-www-form-urlencoded"));
        sPostData = ...;
        hr = xmlHttp->send((BSTR)sPostData);

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Not really familiar with this specific interface but reading the constants it sounds like you are trying to use a client certificate. Is the server configured that way?

    I would strongly suspect the general purpose microsoft built Http Request object can do just about anything you can do over http.


Tags for this Thread

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
  •