• Sergei Golubchik's avatar
    MDEV-31855 validate ssl certificates using client password · 1ef1bab9
    Sergei Golubchik authored
    if the client enabled --ssl-verify-server-cert, then
    the server certificate is verified as follows:
    
    * if --ssl-ca or --ssl-capath were specified, the cert must have
      a proper signature by the specified CA (or CA in the path)
      and the cert's hostname must match the server's hostname.
      If the cert isn't signed or a hostname is wrong - the
      connection is aborted.
    
    * if MARIADB_OPT_TLS_PEER_FP was used and the fingerprint matches,
      the connection is allowed, if it doesn't match - aborted.
    
    * If the connection uses unix socket or named pipes - it's allowed.
      (consistent with server's --require-secure-transport behavior)
    
    otherwise the cert is still in doubt, we don't know if we can trust
    it or there's an active MitM in progress.
    
    * If the user has provided no password or the server requested an
      authentication plugin that sends the password in cleartext -
      the connection is aborted.
    
    * Perform the authentication. If the server accepts the password,
      it'll send SHA2(scramble || password hash || cert fingerprint)
      with the OK packet.
    
    * Verify the SHA2 digest, if it matches - the connection is allowed,
      otherwise it's aborted.
    1ef1bab9
ssl_autoverify.result 1.9 KB