Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

connect() and from_url() factory methods should accept an ssl.SSLContext instance #91

Closed surfacepatterns closed 5 years ago

surfacepatterns commented 8 years ago

Currently, the connect() and from_url() methods have one point of customization for SSL connections in the form of a verify_ssl argument. However, this misses the point as:

  1. asyncio.create_connection accepts server_hostname and ssl arguments
  2. The ssl argument can be an ssl.SSLContext instance that can be customized further than just deciding whether or not server-side certificates should be verified.

In order to support such options, and to be future-compatible with any new options introduced to customize ssl.SSLContext instances, I suggest the following:

  1. Drop the verify_ssl argument. It appears to be a short-sighted attempt to deal with the new default SSL policy introduced with newer versions of Python.
  2. Overload the ssl argument to accept ssl.SSLContext instances, and forward such instances to asyncio.create_connection.
notmeta commented 5 years ago

Added in #142

RemiCardona commented 5 years ago

Closing then.