Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27540

Different OpenSSL versions mix up in build depending on cmake options

    XMLWordPrintable

Details

    Description

      It has probably always been so and affects all versions, just not as obvious as it is with OpenSSL 3. I didn't check existing main trees. Please update affects/fix versions as needed.

      Building with WITH_SSL=<custom path> causes a version mix up:

      preview-10.8-MDEV-25785-openssl3.0 7cd965af9

      $ cmake . -DWITH_SSL=/home/elenst/openssl3-inst
      ...
      -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "3.0.1")  
      -- OPENSSL_INCLUDE_DIR = /home/elenst/openssl3-inst/include
      -- OPENSSL_SSL_LIBRARY = /usr/lib/x86_64-linux-gnu/libssl.so
      -- OPENSSL_CRYPTO_LIBRARY = /usr/lib/x86_64-linux-gnu/libcrypto.so
      -- OPENSSL_VERSION = 3.0.1
      -- SSL_LIBRARIES = /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;dl
      ...
       
      $ ls -l /usr/lib/x86_64-linux-gnu/libssl.so
      lrwxrwxrwx 1 root root 13 Aug 24 11:28 /usr/lib/x86_64-linux-gnu/libssl.so -> libssl.so.1.1
       
      $ make
      /usr/bin/ld: CMakeFiles/mariadb_obj.dir/secure/openssl.c.o: in function `ma_tls_verify_server_cert':
      /data/src/preview-10.8-MDEV-25785-openssl3.0-build-inst/libmariadb/libmariadb/secure/openssl.c:699: undefined reference to `SSL_get1_peer_certificate'
      /usr/bin/ld: CMakeFiles/mariadb_obj.dir/secure/openssl.c.o: in function `ma_tls_get_finger_print':
      /data/src/preview-10.8-MDEV-25785-openssl3.0-build-inst/libmariadb/libmariadb/secure/openssl.c:759: undefined reference to `SSL_get1_peer_certificate'
      [ 20%] Built target GenFixPrivs
      collect2: error: ld returned 1 exit status
      make[2]: *** [libmariadb/libmariadb/CMakeFiles/libmariadb.dir/build.make:155: libmariadb/libmariadb/libmariadb.so.3] Error 1
      make[1]: *** [CMakeFiles/Makefile2:4651: libmariadb/libmariadb/CMakeFiles/libmariadb.dir/all] Error 2
      make[1]: *** Waiting for unfinished jobs....
      

      Same happens with

      cmake . -DWITH_SSL=/home/elenst/openssl3-inst -DSSL_PATH=/home/elenst/openssl3-inst/ -DOPENSSL_ROOT_DIR=/home/elenst/openssl3-inst -DOPENSSL_INCLUDE_DIR=/home/elenst/openssl3-inst/include/ 
      

      This works:

      cmake . -DWITH_SSL=/home/elenst/openssl3-inst -DOPENSSL_SSL_LIBRARY=/home/elenst/openssl3-inst/lib64/libssl.so -DOPENSSL_CRYPTO_LIBRARY=/home/elenst/openssl3-inst/lib64/libcrypto.so
       
      -- Found OpenSSL: /home/elenst/openssl3-inst/lib64/libcrypto.so (found version "3.0.1")  
      -- OPENSSL_INCLUDE_DIR = /home/elenst/openssl3-inst/include
      -- OPENSSL_SSL_LIBRARY = /home/elenst/openssl3-inst/lib64/libssl.so
      -- OPENSSL_CRYPTO_LIBRARY = /home/elenst/openssl3-inst/lib64/libcrypto.so
      -- OPENSSL_VERSION = 3.0.1
      -- SSL_LIBRARIES = /home/elenst/openssl3-inst/lib64/libssl.so;/home/elenst/openssl3-inst/lib64/libcrypto.so;dl
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.