Closed joenano closed 2 years ago
apt install libssl-dev
seems to address this but now
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
choosenim-init: Downloading choosenim-0.8.2_linux_amd64
could not import: SSL_get_peer_certificate
some more info that seems to be related
nim: incompatible with OpenSSL 3.0
The nim source package currently has a hard-coded build-dependency (and runtime dependency) on libssl1.1. Attempting to switch to libssl3 results in an unusable binary:
libssl3 is currently in experimental and expected to be the version of OpenSSL shipped with the next version of Debian. Please work with upstream to ensure this package can be updated for compatibility with OpenSSL 3.
Here is a (not comprehensive or entirely accurate) attempt to check for use of obsolete symbols by nim:
$ for sym in $(sed -n -e'/proc.dynlib:/ { s/^\sproc\s+//; s/*(.//; p }' lib/wrappers/openssl.nim); do objdump -T /usr/lib/x86_64-linux-gnu/libssl.so.3 /usr/lib/x86_64-linux-gnu/libcrypto.so.3 |grep -q $sym\$ || echo "missing symbol $sym"; done missing symbol SSL_library_init missing symbol SSL_load_error_strings missing symbol SSLv23_method missing symbol SSLeay missing symbol SSL_state missing symbol SSLv23_client_method missing symbol SSLv2_method missing symbol SSLv3_method missing symbol SSL_CTX_get_ex_new_index missing symbol bioNew missing symbol bioFreeAll missing symbol bioSMem missing symbol bioCtrlPending missing symbol ErrClearError missing symbol ErrFreeStrings missing symbol ErrRemoveState missing symbol SSL_get_peer_certificate
The solution was installing openssl 1, there is an issue open in nim to support openssl 3 which doesnt seem to be high priority so I will close this.
Perhaps the readme should be updated to reflect incompatibility with Openssl 3.
choosenim aims to work out of the box, so we should fix this
The solution was installing openssl 1, there is an issue open in nim to support openssl 3 which doesnt seem to be high priority so I will close this.
Perhaps the readme should be updated to reflect incompatibility with Openssl 3.
For those wondering how to do this I followed
https://askubuntu.com/questions/1403837/how-do-i-use-openssl-1-1-1-in-ubuntu-22-04
In installing openssl 1.1.1 to /usr/local/ssl
Then ran
export LD_LIBRARY_PATH=/usr/local/ssl/lib
before running choosenim and it seems to work. I've also added export LD_LIBRARY_PATH=/usr/local/ssl/lib
to my bashrc
I think OpenSSL 3.0 is a new major version, not an experimental version. New distributions are adopting this version. ex.Ubuntu 22.04, Fedora36 ...
I would like to you to fix it soon or announce creikey-san solution.
It would be really nice to get this fixed :smile:
Broken on Pop!_OS as well, with the same issue as jonano. (No need to install libssl-dev for me though
)
#!/usr/bin/env bash
set -ex
cd /tmp
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssl/1.1.1l-1ubuntu1.3/openssl_1.1.1l.orig.tar.gz
tar -xvf openssl_1.1.1l.orig.tar.gz
sudo apt install libssl-dev liblzo2-dev libpam0g-dev -y
cd openssl_1.1.1l/
./config shared enable-ec_nistp_64_gcc_128 -Wl,-rpath=/usr/local/ssl/lib --prefix=/usr/local/ssl
make -j 4
sudo make install
sudo ln -s /usr/local/ssl/bin/openssl /usr/local/bin/openssl
echo $'append your .*rc, .*profile, or .*env:\n\nexport LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/ssl/lib"'
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
openssl version
ldconfig -p | grep libcrypto