Skip to content

authentication to a sha256_password account fails over SSL #11440

Closed
@weigon

Description

@weigon

Description

The following code:

mysql --user=root -e "CREATE USER sha256_19 IDENTIFIED WITH sha256_password BY '0123456789012345678'"
php -r 'mysqli_real_connect(mysqli_init(), "127.0.0.1", "sha256_19", "0123456789012345678", "", 6000, "", MYSQLI_CLIENT_SSL);' // throws

Resulted in this output:

PHP Fatal error:  Uncaught mysqli_sql_exception: Access denied for user 'sha256_19'@'localhost' (using password: YES) in Command line code:1
Stack trace:
#0 Command line code(1): mysqli_real_connect()
#1 {main}
  thrown in Command line code on line 1

But I expected this output instead:

Without forcing SSL it works:

php -r 'mysqli_real_connect(mysqli_init(), "127.0.0.1", "sha256_19", "0123456789012345678", "", 6000, "");'

PHP Version

PHP 8.1.2

Operating System

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions