Pergunta

I'm programming some kind of browser in c++ using winsock and got struck in some kind of error. The program works just fine for some pages in the internet, but for some reason it doesn't work for all of them. https://imageshack.com/a/v56q/1

As seen in these images the composed version of Fiddler works while my own program fails. I thought that maybe the HTTPS connection might be the problem, but it doesn't even seem to need a handshake or something similar. The sending part of the program is certainly not the problem because it works with other pages (e.g. the ones in the comments).

Thanks in advance!

Foi útil?

Solução

I thought that maybe the HTTPS connection might be the problem, but it doesn't even seem to need a handshake or something similar.

Yes, HTTPS requires that you perform a rather complicated handshake, which is why essentially nobody attempts to implement HTTPS directly on sockets, and instead uses WinHTTP or WinINET, the two HTTP stacks included in Windows.

While Fiddler is running, you can kinda "cheat" by sending your plaintext request (containing a HTTPS url) to Fiddler, which will then perform the proper secure handshake with the remote server on your behalf and then return the response to your client. (Fiddler is acting as a HTTP-to-HTTPS gateway in this scenario.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top