There is a whole lot more you need to understand before tackling this kind of problem.
Here are the pieces but be warned this is a large topic:
OSI model - Wikipedia
e.g. OpenSSL operates in Layer 6; WinSock in layer 5.
This reference also mentions the network layers model.
HTTPS - Wikipedia
Once you have a grasp of these concepts you may be able to ask a better question, preferably after looking at example code.
In the C++ world you can't go past looking at boost::asio for instance and here's a link to some code to get your heart racing...
GitHub - alexandruc/SimpleHttpsClient: A simple HTTPS client based on Boost Asio.