Finding libssl on a customer's Linux
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
We're using a library which needs to load libssl
in a version 1.0.*
. It doesn't work with libssl.so.1.1
. We need it to work on any Linux system.
We try to load various versions and this usually works, but on system of one customer there's just the following:
/usr/lib64/libssl.so.1.1.0g
/usr/lib64/libssl.so.10
/usr/lib64/libssl.so.1.0.2m
/usr/lib64/libssl.so.1.1
We're trying to load libssl.so.1.0
and libssl.so.1.0.2
, but it doesn't find libssl.so.1.0.2m
because of the trailing "m
".
I wonder what's the naming scheme of libssl, if any?
Do we really need to provide our own version or is there a better way?
Should we loop from libssl.so.1.0.2z
down to libssl.so.1.0.2a
? Should we scan the library path manually?
linux openssl libraries shared-library
add a comment |Â
up vote
1
down vote
favorite
We're using a library which needs to load libssl
in a version 1.0.*
. It doesn't work with libssl.so.1.1
. We need it to work on any Linux system.
We try to load various versions and this usually works, but on system of one customer there's just the following:
/usr/lib64/libssl.so.1.1.0g
/usr/lib64/libssl.so.10
/usr/lib64/libssl.so.1.0.2m
/usr/lib64/libssl.so.1.1
We're trying to load libssl.so.1.0
and libssl.so.1.0.2
, but it doesn't find libssl.so.1.0.2m
because of the trailing "m
".
I wonder what's the naming scheme of libssl, if any?
Do we really need to provide our own version or is there a better way?
Should we loop from libssl.so.1.0.2z
down to libssl.so.1.0.2a
? Should we scan the library path manually?
linux openssl libraries shared-library
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.
â Rui F Ribeiro
Feb 1 at 9:32
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
1
The bigger problem might be not having a test system then. Test theln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.
â Rui F Ribeiro
Feb 1 at 9:38
2
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find anddlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.
â Andrew Henle
Feb 1 at 10:38
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We're using a library which needs to load libssl
in a version 1.0.*
. It doesn't work with libssl.so.1.1
. We need it to work on any Linux system.
We try to load various versions and this usually works, but on system of one customer there's just the following:
/usr/lib64/libssl.so.1.1.0g
/usr/lib64/libssl.so.10
/usr/lib64/libssl.so.1.0.2m
/usr/lib64/libssl.so.1.1
We're trying to load libssl.so.1.0
and libssl.so.1.0.2
, but it doesn't find libssl.so.1.0.2m
because of the trailing "m
".
I wonder what's the naming scheme of libssl, if any?
Do we really need to provide our own version or is there a better way?
Should we loop from libssl.so.1.0.2z
down to libssl.so.1.0.2a
? Should we scan the library path manually?
linux openssl libraries shared-library
We're using a library which needs to load libssl
in a version 1.0.*
. It doesn't work with libssl.so.1.1
. We need it to work on any Linux system.
We try to load various versions and this usually works, but on system of one customer there's just the following:
/usr/lib64/libssl.so.1.1.0g
/usr/lib64/libssl.so.10
/usr/lib64/libssl.so.1.0.2m
/usr/lib64/libssl.so.1.1
We're trying to load libssl.so.1.0
and libssl.so.1.0.2
, but it doesn't find libssl.so.1.0.2m
because of the trailing "m
".
I wonder what's the naming scheme of libssl, if any?
Do we really need to provide our own version or is there a better way?
Should we loop from libssl.so.1.0.2z
down to libssl.so.1.0.2a
? Should we scan the library path manually?
linux openssl libraries shared-library
edited Feb 1 at 10:04
Kusalananda
103k13202318
103k13202318
asked Feb 1 at 8:52
maaartinus
1,62052022
1,62052022
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.
â Rui F Ribeiro
Feb 1 at 9:32
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
1
The bigger problem might be not having a test system then. Test theln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.
â Rui F Ribeiro
Feb 1 at 9:38
2
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find anddlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.
â Andrew Henle
Feb 1 at 10:38
add a comment |Â
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.
â Rui F Ribeiro
Feb 1 at 9:32
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
1
The bigger problem might be not having a test system then. Test theln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.
â Rui F Ribeiro
Feb 1 at 9:38
2
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find anddlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.
â Andrew Henle
Feb 1 at 10:38
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.â Rui F Ribeiro
Feb 1 at 9:32
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.â Rui F Ribeiro
Feb 1 at 9:32
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
1
1
The bigger problem might be not having a test system then. Test the
ln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.â Rui F Ribeiro
Feb 1 at 9:38
The bigger problem might be not having a test system then. Test the
ln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.â Rui F Ribeiro
Feb 1 at 9:38
2
2
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find and
dlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.â Andrew Henle
Feb 1 at 10:38
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find and
dlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.â Andrew Henle
Feb 1 at 10:38
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
I'm not sure how you're opening libssl
- I assume dlopen()
?
Searching a hard-coded list of directory paths for a library sounds rather fragile - you'd be better off letting the dynamic linker do the work for you. Perhaps parsing the output of ldconfig -p
is worth trying? On a Debian system, I see the following:
$ ldconfig -p|grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
On a RHEL 7.4 system:
$ ldconfig -p|grep ssl
libssl3.so (libc6,x86-64) => /lib64/libssl3.so
libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10
Note that on the Debian system the library is in /usr/lib/x86_64-linux-gnu
, whereas on the RHEL system it's in /lib64
(also note the widely varying library names). Unless you use something like the output of ldconfig
, you're going to have to search all of those distribution-specific paths yourself if you plan to "work on any Linux system". Admittedly, the directory paths are listed in /etc/ld.so.conf
but I think using ldconfig
is probably still easier.
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . Butldconfig
and/or/etc/ld.so.conf
may be portable enough.
â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
@RuiFRibeiro Indeed, but the same solution should apply.ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).
â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I'm not sure how you're opening libssl
- I assume dlopen()
?
Searching a hard-coded list of directory paths for a library sounds rather fragile - you'd be better off letting the dynamic linker do the work for you. Perhaps parsing the output of ldconfig -p
is worth trying? On a Debian system, I see the following:
$ ldconfig -p|grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
On a RHEL 7.4 system:
$ ldconfig -p|grep ssl
libssl3.so (libc6,x86-64) => /lib64/libssl3.so
libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10
Note that on the Debian system the library is in /usr/lib/x86_64-linux-gnu
, whereas on the RHEL system it's in /lib64
(also note the widely varying library names). Unless you use something like the output of ldconfig
, you're going to have to search all of those distribution-specific paths yourself if you plan to "work on any Linux system". Admittedly, the directory paths are listed in /etc/ld.so.conf
but I think using ldconfig
is probably still easier.
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . Butldconfig
and/or/etc/ld.so.conf
may be portable enough.
â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
@RuiFRibeiro Indeed, but the same solution should apply.ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).
â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
 |Â
show 1 more comment
up vote
2
down vote
accepted
I'm not sure how you're opening libssl
- I assume dlopen()
?
Searching a hard-coded list of directory paths for a library sounds rather fragile - you'd be better off letting the dynamic linker do the work for you. Perhaps parsing the output of ldconfig -p
is worth trying? On a Debian system, I see the following:
$ ldconfig -p|grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
On a RHEL 7.4 system:
$ ldconfig -p|grep ssl
libssl3.so (libc6,x86-64) => /lib64/libssl3.so
libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10
Note that on the Debian system the library is in /usr/lib/x86_64-linux-gnu
, whereas on the RHEL system it's in /lib64
(also note the widely varying library names). Unless you use something like the output of ldconfig
, you're going to have to search all of those distribution-specific paths yourself if you plan to "work on any Linux system". Admittedly, the directory paths are listed in /etc/ld.so.conf
but I think using ldconfig
is probably still easier.
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . Butldconfig
and/or/etc/ld.so.conf
may be portable enough.
â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
@RuiFRibeiro Indeed, but the same solution should apply.ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).
â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
 |Â
show 1 more comment
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I'm not sure how you're opening libssl
- I assume dlopen()
?
Searching a hard-coded list of directory paths for a library sounds rather fragile - you'd be better off letting the dynamic linker do the work for you. Perhaps parsing the output of ldconfig -p
is worth trying? On a Debian system, I see the following:
$ ldconfig -p|grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
On a RHEL 7.4 system:
$ ldconfig -p|grep ssl
libssl3.so (libc6,x86-64) => /lib64/libssl3.so
libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10
Note that on the Debian system the library is in /usr/lib/x86_64-linux-gnu
, whereas on the RHEL system it's in /lib64
(also note the widely varying library names). Unless you use something like the output of ldconfig
, you're going to have to search all of those distribution-specific paths yourself if you plan to "work on any Linux system". Admittedly, the directory paths are listed in /etc/ld.so.conf
but I think using ldconfig
is probably still easier.
I'm not sure how you're opening libssl
- I assume dlopen()
?
Searching a hard-coded list of directory paths for a library sounds rather fragile - you'd be better off letting the dynamic linker do the work for you. Perhaps parsing the output of ldconfig -p
is worth trying? On a Debian system, I see the following:
$ ldconfig -p|grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
On a RHEL 7.4 system:
$ ldconfig -p|grep ssl
libssl3.so (libc6,x86-64) => /lib64/libssl3.so
libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10
Note that on the Debian system the library is in /usr/lib/x86_64-linux-gnu
, whereas on the RHEL system it's in /lib64
(also note the widely varying library names). Unless you use something like the output of ldconfig
, you're going to have to search all of those distribution-specific paths yourself if you plan to "work on any Linux system". Admittedly, the directory paths are listed in /etc/ld.so.conf
but I think using ldconfig
is probably still easier.
edited Feb 1 at 10:00
answered Feb 1 at 9:35
mjturner
3,8681224
3,8681224
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . Butldconfig
and/or/etc/ld.so.conf
may be portable enough.
â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
@RuiFRibeiro Indeed, but the same solution should apply.ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).
â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
 |Â
show 1 more comment
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . Butldconfig
and/or/etc/ld.so.conf
may be portable enough.
â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
@RuiFRibeiro Indeed, but the same solution should apply.ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).
â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
I think the OP is not in Debian. +1
â Rui F Ribeiro
Feb 1 at 9:37
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . But
ldconfig
and/or /etc/ld.so.conf
may be portable enough.â maaartinus
Feb 1 at 9:41
@RuiFRibeiro I was told, the problematic system is Fedora; anyway we need a solution for any Linux desktop . But
ldconfig
and/or /etc/ld.so.conf
may be portable enough.â maaartinus
Feb 1 at 9:41
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
I agree, that is why I voted you up.
â Rui F Ribeiro
Feb 1 at 9:44
1
1
@RuiFRibeiro Indeed, but the same solution should apply.
ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).â mjturner
Feb 1 at 9:57
@RuiFRibeiro Indeed, but the same solution should apply.
ldconfig -p
should work on any Linux system (I've just confirmed and added some detail).â mjturner
Feb 1 at 9:57
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
You understand I just commented it was not Debian, right?
â Rui F Ribeiro
Feb 1 at 10:13
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f421153%2ffinding-libssl-on-a-customers-linux%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
ln -s /usr/lib64/libssl.so.1.0.2m /usr/lib64/libssl.so.1.0.2
might work.â Rui F Ribeiro
Feb 1 at 9:32
@RuiFRibeiro There are two problems with it: 1. Knowing the exact name. 2. It's a customer's computer.
â maaartinus
Feb 1 at 9:37
1
The bigger problem might be not having a test system then. Test the
ln
, is harmless and can be removed easily. See also @mjturner answer, it recalls important details.â Rui F Ribeiro
Feb 1 at 9:38
2
How are you distributing your library? Don't try to find a compatible copy of OpenSSL on someone else's computer that you have no control over - bring the copy with you. The most reliable way is to distribute a known-compatible copy of the necessary OpenSSL libraries with your own library. Put the OpenSSL shared object(s) in the same directory as your library then find and
dlopen()
it, or statically link OpenSSL and build your shared object(s) so they incorporate the OpenSSL object files from the OpenSSL static libraries.â Andrew Henle
Feb 1 at 10:38