Finally, here I am giving you a C++ tutorial on how to implement OpenSSL in C++ either for windows or Linux.
The video will guide you on how to compile, trouble shoot and link to libraries.
For windows, you need to extract the ZIP file from this URL [Google Code: OpenSSL for Windows] and copy the required folders and files as instructed in the video.
If you have any question please do not hesitate to leave comments below.
Below are the following requirements that have to be installed.
- Minimalist GNU for Windows or MingW then choose g++ compiler
- Includes file and library files including DLLs
- The g++ compiler or simple "sudo apt-get install g++"
- Use the latest openssl or simple upgrade it by using this commad "sudo get-apt install openssl"
Here is to define variables
// For this example, we'll be testing on openssl.org
#define SERVER "www.openssl.org"
#define PORT 443
Here to construct the header
header.append("GET / HTTP1.1\r\n");
Next sending the content in one go
sslWrite (c, (char*)header.c_str());
To read from the server response
while(sslread(c, buffer, 1024) != 0)
Disconnect the socket
If you prefer to use windows, you need to call this functions from the start and end of the program.
if(WSAStartup(MAKEWORD(2, 2), &wsaData))
If you cannot play the video please visit from this URL [Youtube: C++ OpenSSL] and subscribe to receive updates whenever I upload new videos.
|Find out more C Programming Language|