# Concurrent OpenSSL versions woes

**URL:** <https://discourse.cmake.org/t/concurrent-openssl-versions-woes/7012>\
**Category:** Code\
**Created:** [December 4, 2022, 9:46pm UTC](https://discourse.cmake.org/t/concurrent-openssl-versions-woes/7012 "2022-12-04T21:46:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)\
**Post date:** [December 4, 2022, 9:46pm UTC](https://discourse.cmake.org/t/concurrent-openssl-versions-woes/7012/1 "2022-12-04T21:46:59Z")

</div>

My machine has OpenSSL 1.1.1f and 3.0.7 installed concurrently in rather different locations - however the .so files are all in the same dir but under distinct names.  
When I do `find_package(OpenSSL)` and no hints it finds 1.1.1, and printing all variables from the man page (OPENSSL\_LIBRARIES, OPENSSL\_SSL\_LIBRARIES etc) points to this.  
However, when linking it fails as it tries to link to `SSL_get1_peer_certificate` which is a 3.0 specific function not in my code, nor in the libssl.so file CMake specifically says it links to. This libssl.so file is a symlink to libssl.so.1.1.  
I wonder what I can do more to understand the diff between the CMake result variables and the systems reality?  
I can get eg 3.0.7 to work by setting some hints, so mostly just curious what else I can do to understand where 3.0.7 creeps in here.

---

<div class="post-metadata">

**Author:** ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)\
**Post date:** [December 5, 2022, 6:54am UTC](https://discourse.cmake.org/t/concurrent-openssl-versions-woes/7012/2 "2022-12-05T06:54:03Z")

</div>

Look for other `find_package()` calls that might have brought the include directory of OpenSSL 3.x.  
Your issue looks like one of:  
a) your build uses OpenSSL 3.x headers but links to 1.x  
b) some other component you use has been built against v 3.x

---

<div class="post-metadata">

**Author:** ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)\
**Post date:** [December 5, 2022, 9:56pm UTC](https://discourse.cmake.org/t/concurrent-openssl-versions-woes/7012/3 "2022-12-05T21:56:05Z")

</div>

Thanks for the reply. Turns out that if I did a  
`find /usr/ -type f -exec grep -H "SSL_get1_peer_certificate" {} \;`  
I found another header location that I must have made some mistake installing some things into (I think an ldconfig went wrong). But CMake never said it used that location, but obviously did, somewhere. No mention in the generator file or anything though.  
Case closed.
