How to Build OpenSSL, zlib, and cURL libraries on Windows (2024)

OpenSSL, zlib, and cURL are open-source computer software projects to secure communications over computer networks, compress data, and transfer data through various network protocols, respectively. The projects are comprised of command-line tools, header files, and libraries. They are widely used by many systems, applications, and libraries including Refinitiv Real-Time SDK C/C++. Users can utilize available OpenSSL, zlib, and cURL libraries available on the Internet or build the latest versions of those libraries from the source code.

Refinitiv Real-Time SDK C/C++ is a suite of modern and open-source APIs that is designed to simplify development through a strong focus on ease of use and standardized access to a broad set of Refinitiv and proprietary content and services. It uses these libraries to connect to encrypted servers or Refinitiv Real-Time Optimized on the cloud.

This article demonstrates step by step to build OpenSSL, zlib, and cURL libraries from the source code on a Windows machine (Windows 10). Then, it shows how to use these libraries in Refinitiv Real-Time SDK C/C++. The topics include:

  • Build OpenSSL Libraries
  • Build zlib libraries
  • Build cURL Libraries
  • Use the Libraries with Refinitiv Real-Time SDK C/C++

Prerequisites

To follow the steps in this article, you need to have a Windows 10 machine with the following applications installed.

  1. Microsoft Visual Studio: Desktop Development with C++ (such as, Visual Studio 2019 or 2022)
  2. Strawberry Perl: A perl environment for Microsoft Windows (Required to build OpenSSL)
  3. Netwide Assembler (NASM): An assembler for the x86 CPU architecture (Required to build OpenSSL)
  4. A decompression tool, such as WinRAR

Build OpenSSL Libraries

OpenSSL is a software library implementing the SSL and TLS protocols for applications that secure communications over computer networks. It is widely used by Internet servers, including the majority of HTTPS websites. It contains two libraries which are libssl and libcrypto. The libcrypto library provides the fundamental cryptographic routines used by libssl.

The following steps show how to build the OpenSSL libraries and a binary file from the OpenSSL source package on a Windows 10 machine.

1. Download and decompress the OpenSSL source code package

The OpenSSL is open source and the source code is available on the OpenSSL official website (https://www.openssl.org). At the time of this writing, the current versions of the OpenSSL packages are openssl-1.1.1o and openssl-3.0.3.

I will download the openssl-1.1.1o package but the steps mentioned in this article can also be used with the openssl-3.0.3 package.

First, download the OpenSSL source package (openssl-1.1.1o.tar.gz) and decompress it to the local directory, such as C:\local\src.

2. Configure the package

To follow this step, the Perl and NASM directory must be added to the Path environment variable.

You can test it my running “perl -v” and “nasm -v” on the command prompt.

From the previous step, all files are extracted in the openssl-1.1.1.o directory. Run the x64 Native Tools Command Prompt for Visual Studio and then change the directory to C:\local\src\ openssl-1.1.1.o.

Then, run the config command to configure the OpenSSL source package.

I ran the Configure command with the following options.

OptionDescription
--prefix= c:\local\openssl1.1.1The top of the installation directory tree. The OpenSSL libraries will be created in this directory (c:\local\openssl1.1.1)

For other options, please refer to the INSTALL file in the OpenSSL source package.

3. Build the OpenSSL libraries

Run the nmake command to build the OpenSSL libraries (libcrypto and libssl) and the OpenSSL binary (openssl).

The libraries will be built in the top-level directory, and the binary will be in the apps subdirectory.

Finally, run the “nmake install” command to install OpenSSL on the machine.

The command will install all the OpenSSL components in the directory specified in the --prefix option (C:\local\openssl1.1.1). OpenSSL configuration files are in the C:\Program Files\Common Files\SSL directory.

The libraries are in the C:\local\openssl1.1.1\lib and C:\local\openssl1.1.1\bin directory and the OpenSSL binary file is in the C:\local\openssl1.1.1\bin directory.

At this point, the OpenSSL binary and library files are built properly.

Build zlib Libraries

Zlib is a free and general-purpose lossless data-compression software library for use on any computer hardware and software platform, including Linux, macOS, and Windows. The zlib data format is itself portable across platforms. The following steps demonstrate how to build zlib libraries from the zlib source package on a Windows 10 machine.

1. Download and decompress the zlib source code package

Zlib is open source and the source code is available on the zlib official website (https://zlib.net/). At the time of this writing, the current version of the zlib package is zlib-1.2.12. Download the zlib source package (zlib-1.2.12.tar.gz) and decompress it to the local directory, such as C:\local\src.

2. Build the zlib libraries

From the previous step, all files are extracted in the zlib-1.2.12 directory. Run the x64 Native Tools Command Prompt for Visual Studio and then change the directory to C:\local\src\zlib-1.2.12.

Then, run the nmake command to build the zlib libraries.

The following files will be created in the C:\local\src\zlib-1.2.12 directory.

  • zlib.lib: A zlib static library
  • zlib.pdb: A program database file of zlib.lib
  • zdll.lib: An import library of zlib1.dll
  • zlib1.dll: A zlib shared library
  • zlib1.pdb: A program database of zlib1.dll

3. Copy zlib files

In this step, the zlib header files and library files will be copied to the new zlib folder. First, create a new folder for zlib files, such as C:\local\zlib.

Then, copy zlib.h and zconf.h files from C:\local\src\zlib-1.2.12 to C:\local\zlib\include.

Finally, copy the zlib library files from C:\local\src\zlib-1.2.12 to C:\local\zlib\lib directory.

At this point, the zlib library files are built properly.

Build cURL Library

cURL is a computer software project providing a library and a command-line tool for transferring data using various network protocols. It builds and works identically on many platforms. cURL supports HTTPS and performs SSL certificate verification by default when a secure protocol is specified such as HTTPS. It relies on the OpenSSL libraries to perform SSL certificate verification.

The following steps show how to build a cURL library and cURL binary file from the cURL source package on a Windows 10 machine. Moreover, the cURL library and cURL binary file will use the zlib and OpenSSL libraries created in the previous sections.

1. Download and decompress the cURL source code package

cURL is open source and the source code is available on the cURL official website (https://curl.se/download.html). At the time of this writing, the current version of the cURL package is curl-7.83.1.

First, download the cURL source package (curl-7.83.1.tar.gz) and decompress it to the local directory, such as C:\local\src.

2. Build the cURL libraries

From the previous step, all files are extracted in the curl-7.83.1 directory. Run the x64 Native Tools Command Prompt for Visual Studio and then change the directory to C:\local\src\curl-7.83.1\winbuild.

cURL supports many underlying protocols. We can configure it when building the libraries. The following section demonstrates the ways to build the cURL libraries that support Schannel and OpenSSL, respectively.

2.1 Build the cURL libraries that use Schannel and zlib

The Microsoft Secure Channel (Schannel) is a security package that facilitates the use of Secure Sockets Layer (SSL) and/or Transport Layer Security (TLS) encryption on Windows platforms. Schannel will use certificates from the Windows certificate store.

Run the following nmake command to build the cURL libraries and the cURL binary that use Schannel and zlib.

I ran the nmake command with the following options.

OptionDescription
mode=dllBuild a cURL dynamic library
MACHINE=x64Target architecture (default is x86)
WITH_ZLIB=dllEnable zlib support, DLL or static
ZLIB_PATH=C:\local\zlibCustom path for zlib (C:\local\zlib)

cURL files are built in the .\builds\libcurl-vc-x64-release-dll-zlib-dll-ipv6-sspi-schannel directory.

The cURL and DLL files are in the bin directory.

2.2Build the cURL libraries that use OpenSSL and zlib

cURL can be built to support OpenSSL. Run the following nmake command to build the cURL libraries and the cURL binary that use OpenSSL and zlib.

I ran the nmake command with the following options.

OptionDescription
mode=dllBuild a cURL dynamic library
MACHINE=x64Target architecture (default is x86)
WITH_SSL=dllEnable OpenSSL support, DLL or static
SSL_PATH=C:\local\openssl1.1.1Custom path for OpenSSL (C:\local\openssl1.1.1)
WITH_ZLIB=dllEnable zlib support, DLL or static
ZLIB_PATH=C:\local\zlibCustom path for zlib (C:\local\zlib)

cURL files are built in the .\builds\libcurl-vc-x64-release-dll-ssl-dll-zlib-dll-ipv6-sspi directory.

The cURL and DLL files are in the bin directory.

For other options, please refer to the README.md file in the winbuild directory.

At this point, the cURL binary and library files are built properly.

The OpenSSL, zlib, and cURL can be used with the Refinitiv Real-Time SDK C/C++ applications to connect to encrypted servers or Refinitiv Real-Time Optimized on the cloud. Refinitiv Real-Time SDK C/C++ on Windows uses libcurl that supports Schannel.

1. Copy the following files to the current directory of the Refinitiv Real-Time SDK C/C++ application.

  • C:\local\zlib\lib\zlib1.dll
  • C:\local\openssl1.1.1\bin\libcrypto-1_1-x64.dll
  • C:\local\openssl1.1.1\bin\libssl-1_1-x64.dll
  • C:\local\src\curl-7.83.1\builds\libcurl-vc-x64-release-dll-zlib-dll-ipv6-sspi-schannel\bin\libcurl.dll

2. Run the application. The application loads the OpenSSL, zlib, and cURL libraries found in the working directory and then connects to an encrypted server on Refinitiv Real-Time Optimized.

OpenSSL, zlib, and cURL are open-source and popular software projects used to secure communications over computer networks, compress data, and transfer data through various network protocols. Users can easily build the binary packages from the project’s source code. With this method, users can get the latest version of the packages. This article demonstrates step by step to build OpenSSL, zlib, and curl libraries from the source code on a Windows 10 machine. There are a few steps to building the package. The first step is downloading the source code package from the official project website. The second step is decompressing the package. The third step is configuring the package and the final step is building the package. The outcome contains executable files, development libraries, and header files.

1. cURL. n.d.cURL. [online] Available at: <https://curl.se/> [Accessed 3 May 2022].

2. En.wikipedia.org. n.d.cURL - Wikipedia. [online] Available at: <https://en.wikipedia.org/wiki/CURL> [Accessed 3 May 2022].

3. OpenSSL. n.d.OpenSSL. [online] Available at: <https://www.openssl.org/> [Accessed 3 May 2022].

4. En.wikipedia.org. n.d.OpenSSL - Wikipedia. [online] Available at: <https://en.wikipedia.org/wiki/OpenSSL> [Accessed 3 May 2022].

5. Developers.refinitiv.com. n.d.Refinitiv Real-Time C++ SDK | Refinitiv Developers. [online] Available at: <https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-cc> [Accessed 3 May 2022].

6. En.wikipedia.org. n.d.zlib - Wikipedia. [online] Available at: <https://en.wikipedia.org/wiki/Zlib> [Accessed 11 May 2022].

7. Zlib.net. n.d.zlib Home Site. [online] Available at: <https://zlib.net/> [Accessed 11 May 2022].

8. Bacon, M., n.d.What is Microsoft Schannel (Microsoft Secure Channel)? - Definition from WhatIs.com. [online] TechTarget. Available at: <https://www.techtarget.com/searchsecurity/definition/Microsoft-Schannel-Microsoft-Secure-Channel> [Accessed 24 May 2022].

How to Build OpenSSL, zlib, and cURL libraries on Windows (2024)

FAQs

How to build OpenSSL library on Windows? ›

Build and Configure OpenSSL on Windows
  1. Prerequisites. Make sure that you have installed all necessary tools as mentioned on the OpenSSL web page. ...
  2. Configure: OpenSSL for 32 bits (this is done implicitly by the compiler you have selected) ...
  3. Run the build. make.
  4. (Optional) - Test results. make test.

How to build zlib on Windows? ›

Try to build Zlib on Windows command line, with MinGW.
  1. Descend to C:\sw\src\zlib\1.2. 3\zlib-1.2. 3 directory.
  2. Run. make -f win32/Makefile.gcc all.
  3. For debug builds, run. make -f win32/Makefile.gcc LOC="-DDEBUG -g" all.
  4. To clean the project, run. make -f win32/Makefile.gcc clean.

How to build libcurl for Windows? ›

You can build curl on Windows in several different ways. We recommend using the MSVC compiler from Microsoft or the free and open source mingw compiler. The build process is, however, not limited to these. If you use mingw, you might want to use the autotools build system.

How to compile curl with OpenSSL? ›

How to build curl with the latest openssl?
  1. sudo ./configure --with-ssl --with-libssl-prefix=/usr/local/ssl.
  2. ./configure --with-ssl=/usr/local/ssl.
  3. PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure.
  4. PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl.
Jun 2, 2014

How to build zlib from source? ›

Build zlib Libraries
  1. Download the zlib source code. Zlib is open source and the source code is available on the zlib official website (https://zlib.net/). ...
  2. Decompress the zlib source package. ...
  3. Configure the package. ...
  4. Build the zlib libraries.

Is OpenSSL available for Windows? ›

Download the OpenSSL for Windows installation package. Double-click the installation file. If the following error message appears, you should install Microsoft Visual C++ 2008 Redistributables. The installation file can be downloaded here.

What is the difference between curl and libcurl? ›

The curl tool and the libcurl library, both being open source. CURL is usually used as a name for the libcurl binding for PHP. This binding is what PHP users to access libcurl functions from within their PHP programs. Some PHP programs even say they use 'libcurl' when they in fact use this binding.

Can curl be used in Windows? ›

Windows 10, version 1803 or later

If you have version 1803 or later of Windows 10, curl is installed by default.

Is there a curl equivalent in Windows? ›

Wget works on Windows and various Unix/Linux platforms, making it one of the most versatile cURL alternatives available.

Does libcurl require OpenSSL? ›

In this way, libcurl doesn't need to build with separate QUIC libraries and QUIC supporting tls libraries. It would only require building with OpenSSL v3.

How to install curl on Windows? ›

In your browser, navigate to the cURL welcome page at http://curl.haxx.se and click Download. On the cURL Releases and Downloads page, click the link for the SSL-enabled version for your computer's operating system, download the zip file, and install it in a new folder on your computer.

How to install libcurl library? ›

How to install curl and libcurl
  1. Installing Binary Packages. Lots of people download binary distributions of curl and libcurl. ...
  2. Building using vcpkg. ...
  3. Building from git. ...
  4. Static builds. ...
  5. Debug. ...
  6. Select TLS backend. ...
  7. MultiSSL and HTTP/3. ...
  8. Configure finding libs in wrong directory.

How to create OpenSSL certificate in Windows? ›

Introduction
  1. Step 1: Install and run OpenSSL. ...
  2. Step 2: Generate the root private key. ...
  3. Step 3: Create a self-signed certificate. ...
  4. Step 4: Install the root certificate on the workstation(s) ...
  5. Step 5: Create a private key. ...
  6. Step 6: Generate the certificate signing request. ...
  7. Step 7: Upload the certificates to your Teramind server.

How to generate OpenSSL key in Windows? ›

In Windows:
  1. Open the Command Prompt (Start > Programs > Accessories > Command Prompt).
  2. Navigate to the following folder: C:\Program Files\ListManager\tclweb\bin\certs.
  3. Type the following: openssl genrsa -out rsa.private 1024.
  4. Press ENTER. The private key is generated and saved in a file named "rsa.

How to configure OpenSSL on Windows? ›

Step-by-Step Guide to Install OpenSSL on Windows
  1. Download OpenSSL. ...
  2. Run the Installer. ...
  3. Installation Wizard. ...
  4. Copy DLLs to the Windows System Directory. ...
  5. Customize Installation (Optional) ...
  6. Complete the Installation. ...
  7. Set Environment Variables. ...
  8. Open Command Prompt.
Jan 31, 2024

How to build OpenSSL with Visual Studio? ›

  1. Open a Visual Studio Build Tools Command Prompt (Start->All Programs->Visual Studio 20**->Visual Studio Tools->VC->x86 Native Tools Command Prompt for...)
  2. cd to your OpenSSL x86 folder (you created in Setup.6)
  3. Run: perl Configure VC-WIN32 (add no-shared if you just want a static build)
  4. Run: nmake (this will take a bit)

Top Articles
What are Blockchain Servers? | Supermicro
Meet the Brave Akita Dog Breed (That's Not for Everyone)
Swimgs Yuzzle Wuzzle Yups Wits Sadie Plant Tune 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Autumns Cow Dog Pig Tim Cook’s Birthday Buff Work It Out Wombats Pineview Playtime Chronicles Day Of The Dead The Alpha Baa Baa Twinkle
Splunk Stats Count By Hour
Access-A-Ride – ACCESS NYC
Voorraad - Foodtrailers
Byrn Funeral Home Mayfield Kentucky Obituaries
Nc Maxpreps
Stolen Touches Neva Altaj Read Online Free
Irving Hac
Builders Best Do It Center
C Spire Express Pay
Evil Dead Rise Showtimes Near Regal Columbiana Grande
iLuv Aud Click: Tragbarer Wi-Fi-Lautsprecher für Amazons Alexa - Portable Echo Alternative
Inside the life of 17-year-old Charli D'Amelio, the most popular TikTok star in the world who now has her own TV show and clothing line
bode - Bode frequency response of dynamic system
Robert Deshawn Swonger Net Worth
Vegas7Games.com
Ezel Detailing
Puretalkusa.com/Amac
Menus - Sea Level Oyster Bar - NBPT
What Is The Lineup For Nascar Race Today
48 Oz Equals How Many Quarts
Elbert County Swap Shop
Boise Craigslist Cars And Trucks - By Owner
2015 Kia Soul Serpentine Belt Diagram
Cheap Motorcycles Craigslist
Pickle Juiced 1234
Goodwill Houston Select Stores Photos
T&J Agnes Theaters
The Boogeyman Showtimes Near Surf Cinemas
Viewfinder Mangabuddy
Google Chrome-webbrowser
3496 W Little League Dr San Bernardino Ca 92407
Craigslist Putnam Valley Ny
Nsav Investorshub
18 terrible things that happened on Friday the 13th
Lovely Nails Prices (2024) – Salon Rates
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Janaki Kalaganaledu Serial Today Episode Written Update
Clausen's Car Wash
Brandon Spikes Career Earnings
Mudfin Village Wow
Mbfs Com Login
Martha's Vineyard – Travel guide at Wikivoyage
Pas Bcbs Prefix
Madden 23 Can't Hire Offensive Coordinator
Arnold Swansinger Family
Stone Eater Bike Park
Cbs Scores Mlb
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5931

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.