Thread: Using WinINet with HTTPS

  1. #1
    Registered User KonArtis's Avatar
    Join Date
    Mar 2003
    Posts
    34

    Using WinINet with HTTPS

    I'm trying to authenticate with the passport server for an MSN Messenger client (The connection has to be SSL), but the request is never goes through . Does anybody see what I'm doing wrong here?

    Code:
    int AuthenticatePassport(const char *pszUsername, const char *pszPassword)
    {
    	int		nResult=0;
    	HINTERNET	hInternet, hHttpSession, hHttpRequest;
    	
    	// set up connection
    	if ( (hInternet=InternetOpen("MSN", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0)) )
    	{
    		// set up session
    		if ( (hHttpSession=InternetConnect(hInternet, "https://nexus.passport.com", 
    INTERNET_DEFAULT_HTTPS_PORT, 0, 0, INTERNET_SERVICE_HTTP, 0, 0)) )
    		{
    			// open site
    			if ( (hHttpRequest=HttpOpenRequest(hHttpSession, "GET", "/rdr/pprdr.asp", 0, 0, 0, 
    INTERNET_FLAG_SECURE, 0)) )
    			{
    				// send request for login server
    				if ( HttpSendRequest(hHttpRequest, 0, 0, 0, 0) )
    				{
    					// TODO: Connect to login server
    					nResult=1;
    				}
    			}
    			InternetCloseHandle(hHttpRequest);
    		}
    		InternetCloseHandle(hHttpSession);
    	}
    	InternetCloseHandle(hInternet);
    	return nResult;
    }
    For information about the MSN Protocol, I was getting my information here.

    Thanks in advance,
    Joe
    Last edited by KonArtis; 06-06-2005 at 06:27 AM.

  2. #2
    Registered User KonArtis's Avatar
    Join Date
    Mar 2003
    Posts
    34
    For anybody that is interested, the Request wouldn't be sent because I had "https://" at the beginning of the URL.

    -Joe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WinINet examples for c
    By MarkookraM in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-05-2008, 05:36 AM
  2. winInet cache
    By bergi in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-21-2007, 02:44 PM
  3. sending https request
    By sreenu_daram in forum Networking/Device Communication
    Replies: 1
    Last Post: 08-05-2006, 09:08 AM
  4. Using wininet with cookies
    By bithub in forum Windows Programming
    Replies: 4
    Last Post: 06-01-2006, 10:10 PM
  5. Where can i find a tutorial on WinInet?
    By Inquirer in forum C++ Programming
    Replies: 1
    Last Post: 04-24-2002, 04:34 PM