Skip to content

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

Description

@commonism

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.

Activity

  1. jwp commented on Jun 17, 2015

    @jwp
    Contributor

    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.

  2. changed the title [-]Improper SSL certificate verification[/-] [+]Implement SSL certificate verification "verify-full" sslmode[/+] on Jun 17, 2015
  3. esran commented on Jun 15, 2021

    @esran

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

  4. changed the title [-]Implement SSL certificate verification "verify-full" sslmode[/-] [+]Implement "verify-full" and "verify-ca" sslmode[/+] on Jun 16, 2021
  5. jwp commented on Feb 10, 2023

    @jwp
    Contributor

    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

  6. changed the title [-]Implement "verify-full" and "verify-ca" sslmode[/-] [+]Deprecate `sslmode` in favor of user and implementation configured policies.[/+] on Feb 10, 2023
  7. jwp commented on Feb 10, 2023

    @jwp
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions