# App diverting to host OS's openssl libraries in runtime

**URL:** <https://discourse.appimage.org/t/app-diverting-to-host-oss-openssl-libraries-in-runtime/2701>\
**Category:** Creating AppImages\
**Created:** [May 17, 2022, 8:38pm UTC](https://discourse.appimage.org/t/app-diverting-to-host-oss-openssl-libraries-in-runtime/2701 "2022-05-17T20:38:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarok](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@amarok](https://discourse.appimage.org/u/amarok)\
**Post date:** [May 17, 2022, 8:38pm UTC](https://discourse.appimage.org/t/app-diverting-to-host-oss-openssl-libraries-in-runtime/2701/1 "2022-05-17T20:38:39Z")

</div>

I packaged an app that uses OpenSSL and worked around the issue with loading system certificates, but now it seems like I’m bouncing off another OpenSSL-related problem.

It’s a Qt app packaged using linuxdeploy. When running it, on startup it spits out, among others, these three error lines in the log:

```auto
qt.network.ssl: QSslSocket: cannot resolve SSL_get1_peer_certificate
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_get_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_load_verify_dir

```

I thought to myself “okay, it’s looking for OpenSSL 3 symbols in OpenSSL 1.x .so files, but why?” and I ran it through strace:

```auto
$strace -e trace=open,openat,close,read,write,connect,accept ./WhatPulse-aaf9decf-x86_64.AppImage 2>&1 | grep crypto
openat(AT_FDCWD, "/tmp/.mount_WhatPub3M3wQ/usr/bin/../lib/libcrypto.so.3", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/tmp/.mount_WhatPub3M3wQ/usr/bin/../lib/libk5crypto.so.3", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/tmp/.mount_WhatPub3M3wQ/usr/bin/../lib/libcrypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/libcrypto.so", O_RDONLY|O_CLOEXEC) = 29
openat(AT_FDCWD, "/lib64/libcrypto.so.3.0.2", O_RDONLY|O_CLOEXEC) = 29
openat(AT_FDCWD, "/lib64/libcrypto.so.3", O_RDONLY|O_CLOEXEC) = 29
openat(AT_FDCWD, "/lib64/libcrypto.so.1.1.1n", O_RDONLY|O_CLOEXEC) = 29
openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = 29
openat(AT_FDCWD, "/etc/crypto-policies/back-ends/opensslcnf.config", O_RDONLY) = 30
openat(AT_FDCWD, "/etc/crypto-policies/back-ends/openssl.config", O_RDONLY) = 29
openat(AT_FDCWD, "/etc/crypto-policies/back-ends/openssl.config", O_RDONLY) = 29

```

“No such file or directory” was easily resolved by adding a symlink libcrypto.so → libcrypto.so.3 in the AppDir, but still this weird phenomenon of using files located in /lib64 keeps occurring.

The patched executable in the AppImage seems to testify in a coherent way when questioned using the tried and tested ldd polygraph:

```auto
$ ldd ./whatpulse | grep crypto
	libcrypto.so.3 => /tmp/.mount_WhatPuvDSian/usr/bin/./../lib/libcrypto.so.3 (0x00007f7a0c316000)
	libk5crypto.so.3 => /tmp/.mount_WhatPuvDSian/usr/bin/./../lib/libk5crypto.so.3 (0x00007f7a09988000)

```

So… Why does the app change its mind mid-run and resorts to looking for libcrypto files in /lib64? Any ideas?

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [May 22, 2022, 6:05am UTC](https://discourse.appimage.org/t/app-diverting-to-host-oss-openssl-libraries-in-runtime/2701/2 "2022-05-22T06:05:05Z")

</div>

> [@amarok](#):
>
> It’s a Qt app packaged using linuxdeploy.

Please report linuxdeploy related issues to [Issues · linuxdeploy/linuxdeploy · GitHub](https://github.com/linuxdeploy/linuxdeploy/issues).  
linuxdeploy is not part of the AppImage project and its author doesn’t read here.  
Thanks!

[![image](https://canada1.discourse-cdn.com/flex027/uploads/appimage/original/1X/3bb9d409952ea6e6f87afbb3efc5f311955f21af.png)](https://github.com/linuxdeploy/linuxdeploy/issues/new)

---

<div class="post-metadata">

**Author:** ![amarok](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@amarok](https://discourse.appimage.org/u/amarok)\
**Post date:** [May 22, 2022, 8:40am UTC](https://discourse.appimage.org/t/app-diverting-to-host-oss-openssl-libraries-in-runtime/2701/3 "2022-05-22T08:40:07Z")

</div>

Oh, OK! Thank you. I didn’t realize it’s an issue on linuxdeploy’s part, I thought it’s rather me doing something wrong 🙂 I’ll open an issue as you suggested, thank you again!
