tags:

views:

126

answers:

3

I need to access a HTTPS protected website (HTML or XML) from an C++ MFC application and I would like an easy solution. But I did a little research and it's seems to me HTTPS and C++ don't play nice and easy together.

Is there any recommended class library for HTTPS web access? Should be easy to use and not too expensive.

+3  A: 

libcurl has https support. Check out this example.

Marcelo Cantos
beat me to it be 10s. Have an upvote.
Glen
+2  A: 

WinInet

See sample below

  ...
   hOpen = InternetOpen (...);
   Connect = InternetConnect (
                hOpen,                      // InternetOpen handle
                "MyHttpServer",             // Server  name
      INTERNET_DEFAULT_HTTPS_PORT,// Default HTTPS port - 443
                "",                         // User name
                "",                         //  User password
                INTERNET_SERVICE_HTTP,      // Service
      0,                          // Flags
      0                           // Context
                   );
   hReq = HttpOpenRequest (
                hConnect,                   // InternetConnect handle
      "GET",                      // Method
      "",                         // Object name
      HTTP_VERSION,               // Version
      "",                         // Referrer
                NULL,                       // Extra headers
      INTERNET_FLAG_SECURE,       // Flags
      0                           // Context
                );
   ...
Romain Hippeau
Exactly. This is the easy way to go on Windows. Libcurl 'works' but it's a pain to build and use if you're only going to do simple HTTPS GET/POST requests.
Roel
A: 

Additionally check out www.chilkatsoft.com . They have good, easy to use components to do this sort of stuff. Much easier to use than libcurl (or even wininet), and not expensive. I've used their FTP/S component, very nice to use. Free trial.

Roel