# CentOS7 and OpenSSL 1.1

**URL:** https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229
**Category:** Usage
**Created:** [August 9, 2022, 12:49am UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229 "2022-08-09T00:49:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [August 9, 2022, 12:49am UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/1 "2022-08-09T00:49:38Z")

</div>

Similar to [QNX7.0 and openssl 1.1.1](https://discourse.cmake.org/t/qnx7-0-and-openssl-1-1-1/5567), on CentOS 7 (at least) OpenSSL 1.1 is installed as `openssl11`. On CMake 3.23.2, this causes the `pkg_check_modules(_OPENSSL QUIET openssl)` in FindOpenSSL.cmake to fail.

Has this by chance been addressed in a later release?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 17, 2022, 7:57pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/2 "2022-08-17T19:57:53Z")

</div>

There were some recent OpenSSL-on-QNX fixes for 3.24. I’d recommend testing it and reporting back if it doesn’t work.

---

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [August 17, 2022, 8:45pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/3 "2022-08-17T20:45:32Z")

</div>

Looks like [FindOpenSSL.cmake](https://github.com/Kitware/CMake/blob/ad2e7f3c537dc88ea8140bab67c43d25695637f1/Modules/FindOpenSSL.cmake#L150) hasn’t been updated.

I was thinking changing that line to

```cmake
pkg_search_module(_OPENSSL QUIET openssl11 openssl)

```

should do it, but I have no confidence in me.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 17, 2022, 8:54pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/4 "2022-08-17T20:54:28Z")

</div>

Here’s the MR I’m referring to: [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/7232](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7232)

---

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [August 17, 2022, 8:58pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/5 "2022-08-17T20:58:30Z")

</div>

I only mentioned the QNX link because it was a similar issue. I don’t think that will address the CentOS 7 problem of not finding “openssl11” as an alias for “openssl”.

CentOS/RHEL is notorious for handling parallel package versions by giving them new names. `pkg_search_module` seems tailor made for this purpose.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 17, 2022, 9:09pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/6 "2022-08-17T21:09:26Z")

</div>

Please file an issue in that case.

---

<div class="post-metadata">

### Author: ![bcmkakme](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bcmkakme/32/1849_2.png) [@bcmkakme](https://discourse.cmake.org/u/bcmkakme)
#### Post date: [October 23, 2022, 5:19pm UTC](https://discourse.cmake.org/t/centos7-and-openssl-1-1/6229/7 "2022-10-23T17:19:46Z")

</div>

As explained in the [FindOpenSSL.cmake configuration file](https://github.com/Kitware/CMake/blob/ad2e7f3c537dc88ea8140bab67c43d25695637f1/Modules/FindOpenSSL.cmake#L95) and in this [StackOverflow post](https://stackoverflow.com/questions/61954171/openssl-root-dir-for-cmake), you can install an alternative version of OpenSSL at a different location, for example /usr/local/openssl and then use `export OPENSSL_ROOT_DIR=/usr/local/openssl` for CMake to use the newer installation.
