Skip to content

Add set_verify method on ConnectionΒ #255

Closed

Description

@mithrandi

When changing the context with set_context, the verify mode/callback is not updated from the new context, you need to call SSL_set_verify on the connection to update it.

This function is not currently exposed by Cryptography, so it will need to be added there too.

Activity

  1. mithrandi commented on May 6, 2015

    @mithrandi
    Author

    set_verify_depth should probably be added at the same time.

  2. ihamburglar commented on May 7, 2015

    @ihamburglar
    Contributor

    Sorry, what exactly does this do?

  3. mithrandi commented on May 7, 2015

    @mithrandi
    Author

    That method is on Context, not Connection; as previously mentioned, the context settings are used to initialize the connection, but if the context is changed with set_context later, the verification settings from the new context are not transferred to the connection.

  4. mithrandi commented on May 7, 2015

    @mithrandi
    Author

    To elaborate on this a bit further: set_context is commonly used in a callback set with set_tlsext_servername_callback in order to change the context based on which hostname the client requests using SNI; if you want to do client verification on some hostnames but not on others, you need to be able to call SSL_set_verify to change the verification settings on that connection.

  5. ihamburglar commented on May 7, 2015

    @ihamburglar
    Contributor

    Ah gotcha.

  6. added 3 commits that reference this issue on Jun 5, 2019
    e3a9f1a
    91c7159
    b005ac0
  7. mhils commented on Jan 5, 2022

    @mhils
    Member

    We have some renewed interest in this from some folks in mitmproxy/mitmproxy#5019, it also looks like we wouldn't be the only ones for whom this would be useful. I'd be happy to re-add the bindings to cryptography and then update #844.

    @alex, @reaperhulk et al: Is this something you would be willing to merge, or too much extra complexity for too little value? I don't have strong feelings, we can easily continue to work around this on our end if necessary.

  8. reaperhulk commented on Jan 6, 2022

    @reaperhulk
    Member

    Adding this to Connection + a single additional binding in cryptography seems reasonable to me given that you have people interested in actually using it.

  9. added 2 commits that reference this issue on Jan 6, 2022
    f370413
    73fc958
  10. added 2 commits that reference this issue on May 11, 2022
    e059599
    30a4832
  11. added a commit that references this issue on May 13, 2022
    b31622b
  12. locked as resolved and limited conversation to collaborators on Aug 12, 2022
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions