How to build OpenSSL, zlib and cURL libraries on Linux (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 OpenSSL, zlib, and cURL libraries available on the system 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 Linux machine (Centos 7). 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 Linux machine, such as Centos 7 with the following packages installed.

  1. wget: A utility for retrieving files using the HTTP or FTP protocols
  2. perl-core: Base perl meta-package (Required to build OpenSSL)
  3. make:A GNU tool that simplifies the build process for users
  4. gcc: GNU Compiler Collection

You can use the following command to install these packages. The Internet connection is required to install these packages.

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 Linux machine (Centos 7).

1. Download the OpenSSL source code

The OpenSSL is open source and the source code is available on the OpenSSL official website (https://www.openssl.org). The wget command can be used to download the OpenSSL source code package. At the time of this writing, the current versions of the OpenSSL packages are openssl-1.1.1n and openssl-3.0.2.

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

First, change the directory to /usr/local/src. The source code of the OpenSSL package will be extracted in this directory.

Then, run the wget command to download the OpenSSL source package.

Next, run the ls command to verify the OpenSSL source package has been downloaded properly.

2. Decompress the OpenSSL package

The OpenSSL source package file is compressed so the tarcommand can be used to decompress the package.

Run the following tar command to decompress the OpenSSL source package.

3. Configure the package

From the previous step, all files are extracted in the openssl-1.1.1.n directory. Change the directory toopenssl-1.1.1.n.

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

I ran the config command with the following options.

OptionDescription
--prefix=/opt/opensslThe top of the installation directory tree. The OpenSSL libraries will be created in this directory (/opt/openssl)
--openssldir=/usr/local/sslDirectory for OpenSSL configuration files, and also the default certificate and key store

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

4. Build the OpenSSL libraries

Run the make 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.

Next, run the “make test” command to test the libraries.

If all tests pass, the OpenSSL libraries can be copied to other machines.

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

The command will install all the OpenSSL components in the directory specified in the --prefix option (/opt/openssl) and --openssldir option (/usr/local/ssl).

The libraries are in the /opt/openssl/lib directory and the OpenSSL binary file is in the /opt/openssl/bin directory.

The OpenSSL configuration files are in the /usr/local/ssl 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 iOS. 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 Linux machine (Centos 7).

1. Download the zlib source code

Zlib is open source and the source code is available on the zlib official website (https://zlib.net/). The wget command can be used to download the zlib source code package. At the time of this writing, the current version of the zlib package is zlib-1.2.12.

First, change the directory to /usr/local/src. The source code of the zlib library will be extracted in this directory.

Then, run the wget command to download the zlib source package.

Next, run the ls command to verify the zlib source package has been downloaded properly.

2. Decompress the zlib source package

The zlib source package file is compressed so the tarcommand can be used to decompress the package.

Run the following tar command to decompress the zlib source package.

3. Configure the package

From the previous step, all files are extracted in the zlib-1.2.12 directory. Change the directory to zlib-1.2.12.

Then, run the configure command to configure the zlib source package.

I ran the configure command with the following options.

Option

Description

--prefix=/opt/zlib

The top of the installation directory tree. The zlib files will be created in this directory (/opt/zlib)

For other options, please run the “./configure --help” command.

4. Build the zlib libraries

Run the makecommand to build the zlib libraries.

The libraries will be built in the current directory.

Finally, run the “make install” command to install zlib on the machine.

The command will install all the zlib components in the directory specified in the --prefix option (/opt/zlib). The libraries are in the /opt/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 (libcurl) and a command-line tool (curl) 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 Linux machine (Centos 7). Moreover, the cURL library and cURL binary file will use the OpenSSSL and zlib libraries created in the previous sections.

1. Download the cURL source code

The cURL is open source and the source code is available on the cURL official website (https://curl.se/download.html). The wget command can be used to download the cURL source code package. At the time of this writing, the current version of the cURL package is curl-7.83.0.

First, change the directory to /usr/local/src. The source code of the cURL library will be extracted in this directory.

Then, run the wget command to download the cURL source package.

Next, run the ls command to verify the cURL source package has been downloaded properly.

2. Decompress the cURL package

The cURL source package file is compressed so the tarcommand can be used to decompress the package.

Run the following tar command to decompress the cURL source package.

3. Configure the package

From the previous step, all files are extracted in the curl-7.83.0directory. Change the directory tocurl-7.83.0.

Then, run the configure command to configure the cURL source package.

I ran the configure command with the following options.

OptionDescription
--prefix=/opt/curlThe top of the installation directory tree. The cURL files will be created in this directory (/opt/curl)
--with-openssl=/opt/opensslWhere to look for OpenSSL. PATH points to the SSL installation (/opt/openssl)
--with-zlib=/opt/zlibWhere to look for zlib. PATH points to the zlib installation (/opt/zlib)

For other options, please run the “./configure --help” command.

4. Build the cURL libraries

Run the make command to build the cURL libraries (libcurl.a and libcurl.so) and the cURL binary (curl).

The libraries will be built in the lib/.libs/ directory, and the binary will be in the src/.libs/ directory.

Finally, run the “make install” command to install cURL on the machine.

The command will install all the cURL components in the directory specified in the --prefix option (/opt/curl). The libraries are in the /opt/curl/lib directory and the cURL binary file is in the /opt/curl/bin directory.

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

The zlib, OpenSSL, 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.

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

  • /opt/zlib/lib/libz.so.1.2.12
  • /opt/openssl/lib/libssl.so.1.1
  • /opt/openssl/lib/libcrypto.so.1.1
  • /opt/curl/lib/libcurl.so.4.8.0

2. Create the following soft links of those libraries.

  • libz.so => libz.so.1.2.12
  • libcurl.so => libcurl.so.4.8.0

The following commands can be used to create those soft links.

3. Add the location of the OpenSSL and cURL libraries to the LD_LIBRARY_PATH environment variable. For example, the location of the OpenSSL and cURL libraries is /opt/refinitiv/Real-Time-SDK/Cpp-C/Ema/Executables/OL7_64_GCC485/Optimized.

4. Verify that the certification file (cert.pem) is available in the /usr/local/ssl directory.

If the file is not there, you can create /usr/local/ssl directory and copy thecert.pemfile from /etc/pki/tls directory.

Otherwise, instead of copying the certificate file, you can create a soft link of that file in the /usr/local/ssl directory.

5. Run the application. The application loads the OpenSSL and cURL libraries found in the LD_LIBRARAY_PATH environment variable and then connects to an encrypted server on Refitiniv Real-Time Optimized. It uses the certification file in the /usr/local/ssl directory.

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 install these packages by using the package management tool. However, the installed packages may be outdated.

Another option is building 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 Linux machine (Centos 7). There are four 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, header files, and man pages.

  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].
How to build OpenSSL, zlib and cURL libraries on Linux (2024)

FAQs

How to build zlib on Linux? ›

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.

How to build and install OpenSSL on Linux? ›

In most Linux distributions, OpenSSL can be installed using the command, sudo apt-get install openssl or sudo yum install openssl . You can verify that OpenSSL is properly added with the command, openssl version . This command will install OpenSSL on your system.

Where is the OpenSSL library in Linux? ›

20.8. 2 Location of OPENSSL
Operating SystemLibraries
Linux/usr/lib/libssl.so
Windowslibeay32.dll libssl32.dll
Solarislibcrypto.so libssl.so
Mac OS X/usr/lib/libssl.dylib
1 more row

How to build OpenSSL with Visual Studio? ›

Table of Contents
  1. Requirements.
  2. Download and Unpack OpenSSL.
  3. Create a batch file to setup the environment.
  4. Create a batch file for your Visual Studio version.
  5. Optional step - Create batch to build all (debug and release in 32bit and 64bit)
  6. Use batch files.
  7. Copy the Libraries to the SDK Folder Structure.

How do I know if zlib is installed on Linux? ›

To check which version of the Python library zlib is installed, run pip show zlib or pip3 show zlib in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu).

How to create a library in Linux? ›

Procedure
  1. Create intermediate object files with GCC. ...
  2. Turn the object files into a static library (archive) using the ar tool from the binutils package. ...
  3. Use the nm command to inspect the resulting archive: ...
  4. Copy the static library file to the appropriate directory.

How to install OpenSSL libraries? ›

Ubuntu 20.04 LTS
  1. sudo apt-get update && sudo apt-get upgrade. sudo apt install build-essential checkinstall zlib1g-dev -y.
  2. cd /usr/local/src/ wget https://www. openssl. org/source/openssl-1.1.1k. tar. ...
  3. cd /etc/ld. so. conf. d/ ...
  4. mv /usr/bin/c_rehash /usr/bin/c_rehash. BEKUP. mv /usr/bin/openssl /usr/bin/openssl. BEKUP.

How to install OpenSSL step by step? ›

Step-by-Step Guide to Install OpenSSL on Windows
  1. Download OpenSSL. Go to the official OpenSSL website and download the latest version of OpenSSL for Win. ...
  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.
Jan 31, 2024

How to build an OpenSSL static library? ›

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.

What is the OpenSSL package in Linux? ›

OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping, and identify the party at the other end. It is widely used by Internet servers, including the majority of HTTPS websites.

Is OpenSSL installed on Linux by default? ›

Installation. openssl is installed by default on Arch Linux (as a dependency of coreutils). There are various OpenSSL library bindings available for developers: python-pyopenssl.

Where does Linux install libraries? ›

The Filesystem Hierarchy Standard describes the filesystem conventions of a Linux system. In this standard, folders /lib, /usr/lib and /usr/local/lib are the default folders to store shared libraries. The /lib folder has libraries used during the boot time of the system but also used by programs in the /bin folder.

How to configure OpenSSL in Linux? ›

Build and Configure OpenSSL on Linux
  1. Update and install build-essential packages. Check for any updates available by updating the package lists from the repository: ...
  2. Install additional 32-bit libraries. ...
  3. Configure: ...
  4. Run the build. ...
  5. (Optional) - Test results. ...
  6. Install.

How to run OpenSSL from command line? ›

Solution
  1. In Windows, click Start > Run.
  2. In the Open box, type CMD and click OK.
  3. A command prompt window appears.
  4. Type the following command at the prompt and press Enter: cd \OpenSSL-Win32.
  5. The line changes to C:\OpenSSL-Win32.
  6. Type the following command at the prompt and press Enter: ...
  7. Restart computer (mandatory)
Nov 1, 2023

How to install zlib devel in Linux? ›

zlib:
  1. Downloading zlib: Run the command below, wget http://www.zlib.net/zlib-1.2.3.tar.gz.
  2. Extracting files from the downloaded package: tar -xvzf zlib-1.2.3.tar.gz. ...
  3. Configuring zlib Library: ./configure --prefix=/usr/local/zlib. ...
  4. Compiling zlib: make. ...
  5. Installing zlib:

How to create gz in Linux? ›

Gzip Command in Linux – FAQs
  1. To compress a file using gzip , use the following command: gzip filename. ...
  2. To create a .gz file in Linux, use the gzip command: gzip filename. ...
  3. gzip cannot compress directories directly. ...
  4. To decompress a .gz file using gzip , use the -d option: gzip -d filename.gz.
Jul 12, 2024

How to create static library in Linux? ›

Creating a Static Library in Linux
  1. Step 1: Create a C File. The first step is to create a C file that will accommodate all the needed library functions. ...
  2. Step 2: Create a Library Header File. ...
  3. Step 3: Create an Object File. ...
  4. Step 4: Create a Static Library.
Dec 4, 2023

What is zlib in Linux? ›

zlib (/ˈziːlɪb/ or "zeta-lib", /ˈziːtəˌlɪb/) is a software library used for data compression as well as a data format. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compression program.

Top Articles
How to Pay Off $50,000 in Credit Card Debt: Strategies and Advice
TCP SYN (Stealth) Scan (-sS)
No Hard Feelings (2023) Tickets & Showtimes
It's Official: Sabrina Carpenter's Bangs Are Taking Over TikTok
Using GPT for translation: How to get the best outcomes
Mileage To Walmart
Videos De Mexicanas Calientes
EY – все про компанію - Happy Monday
His Lost Lycan Luna Chapter 5
Günstige Angebote online shoppen - QVC.de
Funny Marco Birth Chart
111 Cubic Inch To Cc
Sonic Fan Games Hq
Der Megatrend Urbanisierung
Dark Chocolate Cherry Vegan Cinnamon Rolls
Trivago Sf
UPS Store #5038, The
Heart and Vascular Clinic in Monticello - North Memorial Health
O'Reilly Auto Parts - Mathis, TX - Nextdoor
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
Getmnapp
Prep Spotlight Tv Mn
What Equals 16
At 25 Years, Understanding The Longevity Of Craigslist
Soul Eater Resonance Wavelength Tier List
Relaxed Sneak Animations
10-Day Weather Forecast for Santa Cruz, CA - The Weather Channel | weather.com
Japanese Emoticons Stars
Bj's Tires Near Me
Trust/Family Bank Contingency Plan
Grove City Craigslist Pets
2015 Chevrolet Silverado 1500 for sale - Houston, TX - craigslist
Chase Bank Cerca De Mí
A Man Called Otto Showtimes Near Carolina Mall Cinema
Montrose Colorado Sheriff's Department
Baywatch 2017 123Movies
Babbychula
Ksu Sturgis Library
Td Ameritrade Learning Center
„Wir sind gut positioniert“
More News, Rumors and Opinions Tuesday PM 7-9-2024 — Dinar Recaps
Ursula Creed Datasheet
Casamba Mobile Login
Cult Collectibles - True Crime, Cults, and Murderabilia
Contico Tuff Box Replacement Locks
Yosemite Sam Hood Ornament
Diario Las Americas Rentas Hialeah
Bluebird Valuation Appraiser Login
Arre St Wv Srj
Craigslist Farm And Garden Missoula
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 6642

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.