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

Update SCRAM dependency to 3.0 #645

Closed
jorsol opened this issue Apr 6, 2024 · 5 comments
Closed

Update SCRAM dependency to 3.0 #645

jorsol opened this issue Apr 6, 2024 · 5 comments
Labels
type: dependency-upgrade A dependency upgrade
Milestone

Comments

@jorsol
Copy link
Member

jorsol commented Apr 6, 2024

Feature Request

A new release of the SCRAM dependency is available, update the dependency to version 3.0.

@jorsol jorsol added the type: enhancement A general enhancement label Apr 6, 2024
@jorsol jorsol changed the title Update SCRAM dependency to 3.0 and support channel binding Update SCRAM dependency to 3.0 Apr 6, 2024
@mp911de mp911de added this to the 1.1.0.RELEASE milestone Apr 8, 2024
@mp911de
Copy link
Collaborator

mp911de commented Apr 8, 2024

Thanks a lot for letting us know. The stage-based approach to SCRAM auth is gone and now requires upfront knowledge of whether we want to authenticate via password or a key. Also, the changes look non-trivial.

@jorsol
Copy link
Member Author

jorsol commented Apr 8, 2024

Thanks a lot for letting us know. The stage-based approach to SCRAM auth is gone and now requires upfront knowledge of whether we want to authenticate via password or a key. Also, the changes look non-trivial.

The changes are trivial at least to upgrade the current dependency, using the key or salted password is optional and only needed if the client (r2dbc) does some cache upfront.

What is not so trivial is to allow channel binding, this requires access to the SSLSession to extract the client peer certificate and use it on negotiation.

@jorsol
Copy link
Member Author

jorsol commented Apr 8, 2024

These are the changes needed to upgrade the dependency: #646

Channel binding support is not implemented yet since it needs access to the connection and I'm not familiar with the codebase here, but the idea is to do something like this:
https://github.com/pgjdbc/pgjdbc/blob/84e538b05693c57953bcdbdb9aa4fcebb6d2184f/pgjdbc/src/main/java/org/postgresql/core/v3/ScramAuthenticator.java#L87-L107

@mp911de
Copy link
Collaborator

mp911de commented Apr 8, 2024

Wow. It seems that I got some wrong class for starters and hence I assumed more complex. Thank you so much.

Do you have a pointer for the SSL auth config within Postgres so I can give it a spin?

@mp911de mp911de linked a pull request Apr 8, 2024 that will close this issue
4 tasks
@mp911de mp911de added type: dependency-upgrade A dependency upgrade and removed type: enhancement A general enhancement labels Apr 8, 2024
@mp911de mp911de closed this as completed in 26761e8 Apr 8, 2024
@mp911de
Copy link
Collaborator

mp911de commented Apr 8, 2024

Thanks for your support. I added channel binding by extracting the first certificate from the SSL session. On a related note, there are setups like Google Cloud that put SSL terminators in front of a Postgres box. For the time being, we're only extracting SSL certificates with direct SSL connections where the server terminates SSL and not an SSL proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependency-upgrade A dependency upgrade
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants