question

drjackool-3839 avatar image
0 Votes"
drjackool-3839 asked JeanineZhang-MSFT answered

How connect to HTTPS via MFC internet classes

hi
to connecting a https server do I need certificate for my app or not? I usehttps flag on OpenRequest and Internetseioon classes but server detect my app as http not https!
thanks

c++
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@drjackool-3839

I suggest you could try to use INTERNET_FLAG_SECURE.

1 Vote 1 ·

Unless your server requires the client to have a certificate, other than requesting a https url rather than http, I'm not aware that there's usually anything you need to do.

Can you elaborate on what you mean when you say "server detect my app as http not https"?

0 Votes 0 ·

I send a http url to server that it is a redirection for a https url. but again I send https url the same response returned. both url are same on each character just differ on http and https. so the server think I send http link and send https redirected link again.

redirecting are as follow:
http-》https-》main url
example:
http://t.com/download?m=a.mp3 redirected to https://t.com/download?m=a.mp3 redirected to
https://dl.t.com/a.mp3

0 Votes 0 ·

1 Answer

JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered

@drjackool-3839

I suggest you could try to use INTERNET_FLAG_SECURE.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, it works. But if confuse on INTERNET_FLAGS_*, Which of them is for GetHttpConnection() function and Which of them are for OpenRequest() function?

0 Votes 0 ·

See the documentation, which says:

This flag is used by HttpOpenRequest and InternetOpenUrl, but this is redundant if https:// appears in the URL.The InternetConnect function uses this flag for HTTP connections; all the request handles created under this connection will inherit this flag.


1 Vote 1 ·