> My temporary solution is to link "ssh-keygen" statically with a normal > version of "libcrypto.a", and then have every other program link > dynamically with my altered version of "libcrypto.so". > > I'll at least see if that works. Yeah the problem is **definitely** that the function "OPENSSL_init_crypto" is calling itself recursively. I might have to put in a thread-duration variable to keep track of the stack depth, and only tell it to load the config file on the first call. I also tried playing around with OPENSSL_SSL_CLIENT_ENGINE_AUTO at compile time, but I can't seem to get it to work. Here's my latest stack trace when I link statically with libcrypto.a: OPENSSL_init_crypto, with the following backtrace: ================== FUNCTION CALL STACK BACKTRACE ================== /usr/lib/libcrypto.so.1.1(OPENSSL_init_crypto+0xb3) [0x7fce24d6ca6a] /usr/lib/libcrypto.so.1.1(+0x143126) [0x7fce24d6a126] /lib/libpthread.so.0(+0xf407) [0x7fce2460c407] /usr/lib/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0x9) [0x7fce24dc7fbe] /usr/lib/libcrypto.so.1.1(+0x14317c) [0x7fce24d6a17c] /usr/lib/libcrypto.so.1.1(CRYPTO_new_ex_data+0x1b) [0x7fce24d6a4d3] /usr/lib/libcrypto.so.1.1(BIO_new+0x73) [0x7fce24cc8d37] /usr/lib/libcrypto.so.1.1(BIO_new_fp+0x16) [0x7fce24ccca06] openssl() [0x41fe6e] /lib/libc.so.6(__libc_start_main+0xe7) [0x7fce2426ae77] openssl() [0x42019a] =================================================================== OPENSSL_init_crypto, with the following backtrace: ================== FUNCTION CALL STACK BACKTRACE ================== /usr/lib/libcrypto.so.1.1(OPENSSL_init_crypto+0xb3) [0x7fce24d6ca6a] /usr/lib/libcrypto.so.1.1(+0xd163b) [0x7fce24cf863b] /usr/lib/libcrypto.so.1.1(+0x1456cf) [0x7fce24d6c6cf] /lib/libpthread.so.0(+0xf407) [0x7fce2460c407] /usr/lib/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0x9) [0x7fce24dc7fbe] /usr/lib/libcrypto.so.1.1(OPENSSL_init_crypto+0x2c9) [0x7fce24d6cc80] /usr/lib/libcrypto.so.1.1(+0x143126) [0x7fce24d6a126] /lib/libpthread.so.0(+0xf407) [0x7fce2460c407] /usr/lib/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0x9) [0x7fce24dc7fbe] /usr/lib/libcrypto.so.1.1(+0x14317c) [0x7fce24d6a17c] /usr/lib/libcrypto.so.1.1(CRYPTO_new_ex_data+0x1b) [0x7fce24d6a4d3] /usr/lib/libcrypto.so.1.1(BIO_new+0x73) [0x7fce24cc8d37] /usr/lib/libcrypto.so.1.1(BIO_new_fp+0x16) [0x7fce24ccca06] openssl() [0x41fe6e] /lib/libc.so.6(__libc_start_main+0xe7) [0x7fce2426ae77] openssl() [0x42019a]