mongosh not running: digital envelope routines:alg_module_init:unknown

3.5k Views Asked by At

I have just installed mongodb 7 on my new amazon linux 2023 machine. Mongodb itself appears to be running fine, but I can't run mongosh as I get the error below. I have reinstalled everything multiple times (including openssh), but nothing helps. Any suggestions are greatly appreciated.

[ec2-user@ip-172-31-35-26 ~]$ mongosh
mongosh: OpenSSL configuration error:
00590487347F0000:error:030000A9:digital envelope routines:alg_module_init:unknown option:../deps/openssl/openssl/crypto/evp/evp_cnf.c:61:name=rh-allow-sha1-signatures, value=yes

When I install MongoDB I see this:

Installed:
  cyrus-sasl-2.1.27-18.amzn2023.0.3.x86_64         cyrus-sasl-gssapi-2.1.27-18.amzn2023.0.3.x86_64       mongodb-database-tools-100.8.0-1.x86_64                        mongodb-mongosh-2.0.0-1.el8.x86_64              
  mongodb-org-7.0.1-1.amzn2023.x86_64              mongodb-org-database-7.0.1-1.amzn2023.x86_64          mongodb-org-database-tools-extra-7.0.1-1.amzn2023.x86_64       mongodb-org-mongos-7.0.1-1.amzn2023.x86_64      
  mongodb-org-server-7.0.1-1.amzn2023.x86_64       mongodb-org-tools-7.0.1-1.amzn2023.x86_64             openssl-1:3.0.8-1.amzn2023.0.4.x86_64                         

Complete!
1

There are 1 best solutions below

2
On

Instead of mongodb-mongosh, try installing mongodb-mongosh-shared-openssl3 where v3 is the bundled OpenSSL version of AL2023.

For me, it solved the problem:

$ # run following if you have mongodb-mongosh installed
$ dnf erase -qy mongodb-mongosh
$ # This will install mongodb-mongosh-shared-openssl3
$ dnf install -qy mongodb-mongosh-shared-openssl3

Installed:
  mongodb-mongosh-shared-openssl3-2.0.0-1.el8.aarch64

$ if mongosh --help 1>/dev/null; then echo 'OK'; else echo '!!!NG!!!'; fi
OK

$ # This WILL NOT do
$ dnf install -qy mongodb-mongosh

Installed:
  mongodb-mongosh-2.0.0-1.el8.aarch64

$ if mongosh --help 1>/dev/null; then echo 'OK'; else echo '!!!NG!!!'; fi
mongosh: OpenSSL configuration error:
20B0BFA4FFFF0000:error:030000A9:digital envelope routines:alg_module_init:unknown option:../deps/openssl/openssl/crypto/evp/evp_cnf.c:61:name=rh-allow-sha1-signatures, value=yes


!!!NG!!!
$ dnf erase -qy mongodb-mongosh

Removed:
  mongodb-mongosh-2.0.0-1.el8.aarch64