0

I am trying to build Monero according to the official instructions for OpenBSD but I get the following error:

[…]
[ 42%] Building CXX object contrib/epee/src/CMakeFiles/epee.dir/mlocker.cpp.o
[ 42%] Building CXX object contrib/epee/src/CMakeFiles/epee.dir/buffer.cpp.o
[ 42%] Building CXX object contrib/epee/src/CMakeFiles/epee.dir/net_ssl.cpp.o
/home/kenny/Dokumente/monero/contrib/epee/src/net_ssl.cpp:579:19: error: use of undeclared identifier 'SSL_CTX_get0_privatekey'
  if (!(ssl_key = SSL_CTX_get0_privatekey(ctx)) || !(ssl_cert = SSL_CTX_get0_certificate(ctx)))
                  ^
1 error generated.
gmake[3]: *** [contrib/epee/src/CMakeFiles/epee.dir/build.make:303: contrib/epee/src/CMakeFiles/epee.dir/net_ssl.cpp.o] Fehler 1
gmake[3]: Verzeichnis „/home/kenny/Dokumente/monero/build/OpenBSD/master/release“ wird verlassen
gmake[2]: *** [CMakeFiles/Makefile2:1692: contrib/epee/src/CMakeFiles/epee.dir/all] Fehler 2
gmake[2]: Verzeichnis „/home/kenny/Dokumente/monero/build/OpenBSD/master/release“ wird verlassen
gmake[1]: *** [Makefile:160: all] Fehler 2
gmake[1]: Verzeichnis „/home/kenny/Dokumente/monero/build/OpenBSD/master/release“ wird verlassen
gmake: *** [Makefile:107: release-static] Fehler 2

I appreciate any help.

0
2

You need to install OpenSSL v1.1.x, a requirement it seems now in Monero v17.2.0.

2
  • Thank you. But I still get the same error after installing OpenSSL v1.1.
    – kaktus
    Apr 27 at 8:12
  • Sounds like cmake is still picking up the older version of OpenSSL. Either remove/replace with the the newer version or override with the -DOPENSSL_* cmake options.
    – jtgrassie
    Apr 27 at 13:50
1

This is because you're not using OpenSSL but libreSSL, which has this particular API difference which trips some recent code.

For now, you have to use openssl until someone fixes this for libressl.

3
  • Is it possible to point to OpenSSL during the building process or would it be necessary to switch from LibreSSL to OpenSSL for the entire OS? If the latter is the case then I am going to give up my plans for running Monero on OpenBSD. I would rather use a linux machine for that…
    – kaktus
    Apr 27 at 13:50
  • git grep finds: "Dockerfile:ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}" so I guess doing this will work, though I have not tried.
    – user36303
    Apr 27 at 17:22
  • Also a message from the cmake files: "cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0'" so it seems likely this'd work
    – user36303
    Apr 27 at 17:23
0

Inspired by code from the OpenVPN devel mailinglist: Support classic OpenSSL/LibreSSL API

Update: since Jul 27, 2021, a similar, but different fix is in the master branch on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.