Skip to content

Deprecate sslmode in favor of user and implementation configured policies. #75

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

Open
commonism opened this issue Jun 17, 2015 · 4 comments
Labels

Comments

@commonism
Copy link

I'm having issues getting SSL certificate verification to fail - even when using self signed certificates, different hostnames, or passing a random root ca.
Therefore I think it is safe to assume SSL certificate verification is broken.

ssl.wrap_socket does not verify the hostname, ssl.match_hostname is not used in the code.

And - the sslmode keywords differ from postgresql sslmode keywords, having at least "verify-full" would be good.

@jwp
Copy link
Contributor

jwp commented Jun 17, 2015

I don't recall "verify-full" being around when I wrote it. Also, I don't believe certificate verification had a documented interface (Python's built-in ssl module) when I wrote it as well.

@jwp jwp changed the title Improper SSL certificate verification Implement SSL certificate verification "verify-full" sslmode Jun 17, 2015
@jwp jwp added the v1.4 label Dec 10, 2020
@esran
Copy link

esran commented Jun 15, 2021

Postgres also has verify-ca for sslmode which should be included in support.

@jwp jwp changed the title Implement SSL certificate verification "verify-full" sslmode Implement "verify-full" and "verify-ca" sslmode Jun 16, 2021
@jwp
Copy link
Contributor

jwp commented Feb 10, 2023

Looks like recent ssl versions perform at least one level of certificate verification. With libpq, the entire chain is checked according to https://www.postgresql.org/docs/current/libpq-ssl.html#LIBQ-SSL-CERTIFICATES

I think the future of sslmode in py-postgresql is deprecation.

Mimicking libpq's connect behavior was one of the more painful features to implement and playing catch-up with features that are primarily intended for psql sessions doesn't really fit well when Python's ssl has its own means for configuring policies.

#122

@jwp jwp changed the title Implement "verify-full" and "verify-ca" sslmode Deprecate sslmode in favor of user and implementation configured policies. Feb 10, 2023
@jwp
Copy link
Contributor

jwp commented Feb 10, 2023

Plan for this will be to introduce the secure parameter in v1.4, and emit deprecation warnings in a subsequent bug fix.

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

3 participants