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 Postgres TLS connections. #2

Closed
wants to merge 4 commits into from

Conversation

kurtraschke
Copy link
Contributor

This PR adds support for TLS connections using the postgres-native-tls crate.

@kurtraschke kurtraschke closed this Jul 3, 2023
@kurtraschke kurtraschke deleted the add-tls-support branch July 3, 2023 19:14
@exyi
Copy link
Owner

exyi commented Jul 3, 2023

Hi, thanks for the patch! Don't worry about the GA too much 😅 (especially weird architectures), I can have a look at this and try to fix it. Since the arm64 stuff is cross compiled on amd64, getting openssl there might be quite non-trivial, I'd say we can just omit TLS support on non-x86 architectures for now (as I did with jemallocator). Another option to try would be the rust implementation of TLS, but I have no experience with that, so I have no idea if it will solve more problems than bring :]

@kurtraschke
Copy link
Contributor Author

I nuked this for now so I could tinker with the configuration a bit more without dumping a bunch of intermediate commits in the PR (though I'd have squashed in the end anyway). In the present state, I do have it building on arm64 with cross, and in theory the same approach should work for riscv64 but there isn't a Debian riscv64 package of libssl-dev (which I suppose is not surprising?). musl support also seems to be a lost cause, at least with the present build setup - although there are Docker containers out there that claim to be able to build Rust packages under musl with a statically compiled OpenSSL included.

All that to say the upshot is that this should work for native Linux builds on any architecture where OpenSSL is available, as well as on Windows and macOS (where other system-level TLS facilities are used). If you are interested in cleaning up the rough edges, I'll squash my current working branch and reopen.

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.

2 participants