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

mysql_init() unconditionally sets use_ssl=1, making --skip-ssl ineffective

    XMLWordPrintable

Details

    Description

      mariadbd has have_ssl=TRUE enabled. When I use mariadb-backup to perform a backup, the following error occurs:

      $ sudo /root/tool/mariadb-11.4.12-linux-systemd-x86_64/bin/mariadb-backup --backup --target-dir=~/data --user=root --password=xxxxxx
      [00] 2026-06-16 18:50:00 Connecting to MariaDB server host: localhost, user: root, password: set, port: not set, socket: /run/mysqld/mysqld.sock
      [00] 2026-06-16 18:50:00 Failed to connect to MariaDB server: SSL connection error: ok.
      

      Obviously, I did not specify SSL for mariadb-backup, but it still tries to establish an SSL connection.
      Even using --skip-ssl yields the same result.
      After reading the source code, I suspect the possible cause is:
      Since mysql_init() already sets use_ssl=1, the check above is meaningless — CLIENT_SSL is always added to the client flags regardless of whether any SSL options are configured. The command-line --skip-ssl option only sets a separate global variable opt_use_ssl to 0, but this is never propagated to mysql->options.use_ssl.

      Attachments

        1. mariadb-conf.tar.gz
          4 kB
          aderversa
        2. mdev-40066.test
          0.7 kB
          Shipra Jain

        Issue Links

          Activity

            People

              shipjain Shipra Jain
              aderversa aderversa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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