Probably the best way is to install openssl-1.1 in a different
prefix such as /opt/openssl-1.1, and when compiling fetchmail set
PKG_CONFIG_PATH to first look in /opt/openssl-1.1/lib64/pkgconfig and
set LD_LIBRARY_PATH to /opt/openssl-4.1/lib64. When running fetchmail
you would also need to set LD_LIBRARY_PATH, say by starting fetchmail
via a shell script.
Yes, that will probably be neccessary, on Slackware 14.2
"ldd /usr/bin/fetchmail" shows:
linux-vdso.so.1 (0x00007ffe78bc2000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f98e49ac000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f98e4791000)
libssl.so.1 => /lib64/libssl.so.1 (0x00007f98e451d000)
libcrypto.so.1 => /lib64/libcrypto.so.1 (0x00007f98e40c5000)
libc.so.6 => /lib64/libc.so.6 (0x00007f98e3cfc000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f98e3af7000)
/lib64/ld-linux-x86-64.so.2 (0x0000557b6be1a000)
So fetchmail is dynamically linked to /lib64/libssl.so.1 which is a
symbolic link to libssl.so.1.0.0 which comes from the openssl-1.0.2u
(which by the way was updated again just some day ago)
If you are lucky, fetchmail and other applications will work better out-
of-the box with the new 1.1 versions of the dynamic libraries from
openssl-1.1, but maybe something will break. If so, there is no better
suggestion than to install then newer version of openssl in another
prefix and recompile selected applications against the newer version.
Maybe you want to statically link those recompiled applications to avoid
the need to set LD_LIBRARY_PATH before running the recompiled
applications.
You will not be able to have both versions of openssl installed next to
each other in their ordinary directory structure as they probably both
want to use the symbolic link libssl.so.1 and they probably both want to
use the same header files in /usr/include/openssl.
regards Henrik