[php-src] Issue #11440: authentication to a sha256_password account fails over SSL

From: Date: Mon, 12 Jun 2023 15:12:13 +0000
Subject: [php-src] Issue #11440: authentication to a sha256_password account fails over SSL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244676@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11440
Author: 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


Thread (1 message)

  • weigon
« previous php.bugs (#244676) next »