0

I am trying to incorporate some SSL/TLS into some Windows Sockets. I can't find any good examples so right now I am looking into the WinHTTP API.

I am wondering if this can be used like traditional socket send() and recv() functionality? I found an example of some code from Windows here:

https://github.com/Microsoft/Windows-classic-samples/blob/master/Samples/WinhttpWebsocket/cpp/WinhttpWebsocket.cpp

I have compiled it and tested using nc and I am getting the HTTP Headers printed to the command prompt. I don't need any of those headers as I want to create my own protocol and send my own data. Is it possible to not use those headers and not use any kind of GET/POST keywords and just treat this as normal socket operations?

Or should I be looking somewhere else? I don't want to use OpenSSL or any 3rd party libraries.

Halloween
  • 388
  • 3
  • 15

1 Answers1

0

WinHTTP was developed as a light-weight HTTP library to replace WinINet in service applications. It is basically WinINet without FTP/Gopher support and no user preferences.

I doubt WinHTTP allows you to perform connections that are not based on the HTTP protocol, you need to go to a lower layer like SChannel for example. SChannel supports SSL and TLS.

The Windows SDK used to have a SSPI example.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thank you. I have been looking into SChannel and it seems to be lacking good documentation/examples. I am a learn from example kind of person so examples help me. I will look more into the SChannel to see what I can find out. – Halloween Apr 28 '19 at 16:10