Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating a user in Redshift with 'sha256 hash' encrypted password and salt, the SQL tools cannot connect #1415

Open
1 task done
dikalex opened this issue Dec 18, 2024 · 0 comments
Labels

Comments

@dikalex
Copy link

dikalex commented Dec 18, 2024

Describe the bug
I am using SQL tools in VS Code with PostgreSQL (v 0.5.4) and Redshift (v 0.0.4) drivers.
When a user is created in a Redshift cluster with plain text password, the connection works OK for both drivers.
But, when I create a user with sha256 encrypted password and salt, the connection does not work. It tries to connect and then says Connection terminated.

In the logs, I see following:
Error: Unknown authenticationOk message type 13
at t.Parser.parseAuthenticationResponse (c:\Users\dikle.vscode\extensions\kj.sqltools-driver-redshift-0.0.4\out\ls\plugin.js:2:113122)
at t.Parser.handlePacket (c:\Users\dikle.vscode\extensions\kj.sqltools-driver-redshift-0.0.4\out\ls\plugin.js:2:109877)
at t.Parser.parse (c:\Users\dikle.vscode\extensions\kj.sqltools-driver-redshift-0.0.4\out\ls\plugin.js:2:108689)
at TLSSocket. (c:\Users\dikle.vscode\extensions\kj.sqltools-driver-redshift-0.0.4\out\ls\plugin.js:2:105368)
at TLSSocket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)

Same time, i can connect with user creds using ODBC or JDBC drivers, so the user and creds are legit.

To Reproduce
Steps to reproduce the behavior:

  1. create a user with sha256 hash encrypted password, like described here https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html
  2. create a new connection in VS Code via SQLTools using either PostgreSQL (v 0.5.4) or Redshift (v 0.0.4) drivers.
  3. Test connection and provide the password you used to create the user and sha256 hash
  4. See error in the log

Expected behavior
Successful connection to the DB.

Desktop (please complete the following information):

  • SQLTools Version 0.28.3
  • VS Code Version: 1.96.0
  • OS: Windows 10 64-bit
  • Driver:
    • PostgreSQL/Redshift
  • Database version: Redshift 1.0.79229
@dikalex dikalex added the triage label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant