0

Im trying make a POST request to a server using TLSv1.2.

The problems i have here are:

How to make a connection with TLSv1.2 secure socket layer ?

How to HPACK the headers ?

How to send the body(DATA) to same stream i think that is via the Stream identifier flag but i don't know how to do it programatically.

On the next picture you have an example about what im trying to reproduce in c++:

Picture

I think this WSAConnect function can work with TLSv1.2 connection but i'm not sure at all.

I try too HPACK encoder/decoder header but when i import the header on Visual Studio 2017 gives me some errors in 4 or 5 lines.

And finally send DATA to the same stream, i think the data via TLSv1.2 need by encrypted but no compressed like the HEADERS.

My question is how can i do it programatically in c++ ?

With simple example and good explanation is sufficient.

EDIT1:

I find openssl client for c++, looks like work with TLSv1.2

Community
  • 1
  • 1
Alan Mars
  • 9
  • 2
  • What have you tried? What does your current code look like? – Jesper Juhl May 30 '20 at 17:00
  • I don't do anything because im getting errors on HPACK encoder/decoder, but the first step was using https://learn.microsoft.com/en-us/windows/win32/winsock/using-secure-socket-extensions so, this is the connection, but im not sure if this perform TLSv1.2, after that i need create HPACK for headers but idk how to do it – Alan Mars May 30 '20 at 17:02
  • Winsock has no concept of TLS. You need to use a TLS API/library on top of the socket, such as Microsoft's SChannel, OpenSSL, etc. Otherwise, use an HTTP API/library that handles its own socket connections for you, such as Microsoft's WinInet/WinHTTP, libcurl, etc. Don't implement HTTP/TLS manually, they are very complex protocols – Remy Lebeau May 30 '20 at 18:43

0 Answers0