Skip to content

Unable to specify password with special chars in DSN #652

Closed
@jeff1985

Description

@jeff1985

With the recent change and introduction of enqueue/dsn (https://github.com/php-enqueue/dsn/blob/master/Dsn.php) I'm not able to specify a password with special chars in the DSN string. Before I was using it with the following syntax:

rediss://hostname?timeout=10&pass=XXXX%2Fs%3D

I'm using a major cloud provider for the redis resource, the password is auto-generated and always contains special chars. Before I was using urlencode to pass the special chars as parameter and it was working fine.

Now as I see, I have to specify the password in the "user:pass@host" syntax, so it would be something like this:

rediss://user:XXXX%2Fs%3D@hostname?timeout=10
  1. How can I leave out the user? I dont have a user for the connection. Only a "key"=password.
  2. If done like this, the password will not be decoded, and the server will report failed authentication.
  3. I also can not pass the password as is, because then parse_url is not able to parse it at all!

Easy to verify:

php > echo parse_url("rediss://user:XXXX%2Fs%3D@host.com/", PHP_URL_PASS);
XXXX%2Fs%3D
php > echo parse_url("rediss://user:XXXX".urldecode("%2Fs%3D")."@host.com/", PHP_URL_PASS);
php >

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions