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

Add support for postgresql protocol #77

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

tarvip
Copy link
Contributor

@tarvip tarvip commented Aug 19, 2021

With postgresql to initiate SSL-encrypted connection specific combination
of bytes must be sent to the server.

Message flow is described on following page
https://www.postgresql.org/docs/13/protocol-flow.html#id-1.10.5.7.11

And SSLRequest message format is described on
https://www.postgresql.org/docs/13/protocol-message-formats.html

The value of SSLRequest message becomes to bytes that is used in the code

@tarvip tarvip force-pushed the postgres-support branch 3 times, most recently from 2a18b2d to 6efd4b2 Compare August 19, 2021 08:31
prober/tcp.go Outdated Show resolved Hide resolved
Copy link
Owner

@ribbybibby ribbybibby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you so much for the contribution! I kept meaning to get around to adding this feature but never found the time.

I've left one small comment about the name of the option, other than that it looks good to me.

I'm going to spin up a postgres to check it out as soon as I can.

With postgresql to initiate SSL-encrypted connection specific combination
of bytes must be sent to the server.

Message flow is described on following page
https://www.postgresql.org/docs/13/protocol-flow.html#id-1.10.5.7.11

And SSLRequest message format is described on
https://www.postgresql.org/docs/13/protocol-message-formats.html

The value of SSLRequest message becomes to bytes that is used in the code
Copy link
Owner

@ribbybibby ribbybibby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanity checked against a local postgres server and it looks good to me.

Thinking about it, we should probably add some tests against an actual postgres server but that's outside the scope of this PR and applies to our other starttls targets and probers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants