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

Galera SST scripts should use ssl_capath (not ssl_ca) for CA directory

Details

    Description

      Based on a discussion with sysprg, the SST script changes from MDEV-26360 allow users to configure a CA directory by setting ssl_ca, like this:

      [mariadb]
      ...
      wsrep_ssl_mode = SERVER_X509
       
      ssl_ca = /certs/ca-cert/
      ssl_cert = /certs/server-cert.pem
      ssl_key = /certs/server-key.pem
      

      This implementation is likely to result in problems. ssl_ca is a system variable owned by MariaDB Server. MariaDB Server expects the ssl_ca system variable to refer to an absolute path to a single PEM file:

      ssl_ca
      Description: Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for TLS. This system variable requires that you use the absolute path, not a relative path. This system variable implies the ssl option.

      https://mariadb.com/kb/en/ssltls-system-variables/#ssl_ca

      If a Galera user tries to set the ssl_ca system variable to a path to a directory, MariaDB Server is likely to encounter an error during startup when it tries to treat the value as a path to a PEM file.

      However, there is an easy solution. MariaDB Server provides the ssl_capath system variable to refer to a directory:

      ssl_capath
      Description: Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for TLS. This system variable requires that you use the absolute path, not a relative path. The directory specified by this variable needs to be run through the openssl rehash command. This system variable implies the ssl option.

      https://mariadb.com/kb/en/ssltls-system-variables/#ssl_capath

      If we would like Galera users to be able to specify a path to a directory of CA certificates, we should probably use ssl_capath for this--not ssl_ca.

      Attachments

        Issue Links

          Activity

            GeoffMontee Geoff Montee (Inactive) created issue -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Field Original Value New Value
            sysprg Julius Goryavsky made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            GeoffMontee Geoff Montee (Inactive) made changes -
            Description Based on a discussion with [~sysprg], the SST script changes from MDEV-26360 allow users to configure a CA directory by setting {{ssl_ca}}, like this:

            {code:ini}
            [mariadb]
            ...
            wsrep_ssl_mode = SERVER_X509

            ssl_ca = /certs/ca-cert/
            ssl_cert = /certs/server-cert.pem
            ssl_key = /certs/server-key.pem
            {code}

            This implementation is likely to result in problems. {{ssl_ca}} is a system variable owned by MariaDB Server. MariaDB Server expects the {{ssl_ca}} system variable to refer to an absolute path to a single PEM file:

            {quote}
            ssl_ca
            Description: Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for TLS. This system variable requires that you use the absolute path, not a relative path. This system variable implies the ssl option.
            {quote}

            https://mariadb.com/kb/en/ssltls-system-variables/#ssl_ca

            If a Galera user tries to set the {{ssl_ca} system variable to a path to a directory, MariaDB Server is likely to encounter an error during startup when it tries to treat the value as a path to a PEM file.

            However, there is an easy solution. MariaDB Server provides the {{ssl_capath}} system variable to refer to a directory:

            {quote}
            ssl_capath
            Description: Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for TLS. This system variable requires that you use the absolute path, not a relative path. The directory specified by this variable needs to be run through the openssl rehash command. This system variable implies the ssl option.
            {quote}

            https://mariadb.com/kb/en/ssltls-system-variables/#ssl_capath

            If we would like Galera users to be able to specify a path to a directory of CA certificates, we should probably use {{ssl_capath}} for this--not {{ssl_ca}}.
            Based on a discussion with [~sysprg], the SST script changes from MDEV-26360 allow users to configure a CA directory by setting {{ssl_ca}}, like this:

            {code:ini}
            [mariadb]
            ...
            wsrep_ssl_mode = SERVER_X509

            ssl_ca = /certs/ca-cert/
            ssl_cert = /certs/server-cert.pem
            ssl_key = /certs/server-key.pem
            {code}

            This implementation is likely to result in problems. {{ssl_ca}} is a system variable owned by MariaDB Server. MariaDB Server expects the {{ssl_ca}} system variable to refer to an absolute path to a single PEM file:

            {quote}
            ssl_ca
            Description: Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for TLS. This system variable requires that you use the absolute path, not a relative path. This system variable implies the ssl option.
            {quote}

            https://mariadb.com/kb/en/ssltls-system-variables/#ssl_ca

            If a Galera user tries to set the {{ssl_ca}} system variable to a path to a directory, MariaDB Server is likely to encounter an error during startup when it tries to treat the value as a path to a PEM file.

            However, there is an easy solution. MariaDB Server provides the {{ssl_capath}} system variable to refer to a directory:

            {quote}
            ssl_capath
            Description: Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for TLS. This system variable requires that you use the absolute path, not a relative path. The directory specified by this variable needs to be run through the openssl rehash command. This system variable implies the ssl option.
            {quote}

            https://mariadb.com/kb/en/ssltls-system-variables/#ssl_capath

            If we would like Galera users to be able to specify a path to a directory of CA certificates, we should probably use {{ssl_capath}} for this--not {{ssl_ca}}.
            sysprg Julius Goryavsky made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            sysprg Julius Goryavsky made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            sysprg Julius Goryavsky made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            sysprg Julius Goryavsky made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            sysprg Julius Goryavsky made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            sysprg Julius Goryavsky made changes -
            Assignee Julius Goryavsky [ sysprg ] Jan Lindström [ jplindst ]
            Status Stalled [ 10000 ] In Review [ 10002 ]

            In my opinion this is ok to push.

            jplindst Jan Lindström (Inactive) added a comment - In my opinion this is ok to push.
            jplindst Jan Lindström (Inactive) made changes -
            Assignee Jan Lindström [ jplindst ] Ramesh Sivaraman [ JIRAUSER48189 ]
            sysprg Julius Goryavsky made changes -
            sysprg Julius Goryavsky made changes -
            Assignee Ramesh Sivaraman [ JIRAUSER48189 ] Julius Goryavsky [ sysprg ]
            sysprg Julius Goryavsky added a comment - Fixed: https://github.com/MariaDB/server/commit/8bb55633699612279744c055e22eeca8d4058273 https://github.com/MariaDB/server/commit/7bc629a5ce9e1edf2c27ddfba2a55c4341d55b4f https://github.com/MariaDB/server/commit/dda0bfaaecc898d7a4b1e1234e0f5083294ccf6e
            sysprg Julius Goryavsky made changes -
            issue.field.resolutiondate 2021-12-14 13:08:20.0 2021-12-14 13:08:20.495
            sysprg Julius Goryavsky made changes -
            Fix Version/s 10.2.42 [ 26803 ]
            Fix Version/s 10.3.33 [ 26805 ]
            Fix Version/s 10.4.23 [ 26807 ]
            Fix Version/s 10.5.14 [ 26809 ]
            Fix Version/s 10.6.6 [ 26811 ]
            Fix Version/s 10.7.2 [ 26813 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            sysprg Julius Goryavsky made changes -
            hholzgra Hartmut Holzgraefe made changes -

            People

              sysprg Julius Goryavsky
              GeoffMontee Geoff Montee (Inactive)
              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.