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.
If you purchased a dedicated IP address and an SSL certificate was installed immediately afterward, the domain can still be associated with the previous IP address. To solve the problem, just wait a while. As soon as the DNS records are updated, the error will disappear.
Another problem with running an HTTPS site is the cost of operations. "Although servers are faster and implementations of SSL more optimized, it still costs more than doing plain http," writes Lafon.
HTTP vs HTTPS Performance. In general, HTTP is faster than HTTPS due to its simplicity. In HTTPS, we have an additional step of SSL handshake unlike in HTTP. This additional step slightly delays the page load speed of the website.
libcurl has https support. Check out this example.
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
);
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With