Skip to content

Conversation

@tomplus
Copy link
Contributor

@tomplus tomplus commented Nov 26, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

In my last PR (#6968) I had to add some hack to disable SSL in older versions of Python. I looked into the implementation and I found that Tornado also didn't support older version of SSL in Python for security reasons (tornadoweb/tornado#2177). Moreover it implements everything we need and also there is a notice about pycurl which doesn't work with SSLContext. Finally I switched to their implementation and it's simple and works correctly with SimpleAsyncHTTPClient and CurlAsyncHTTPClient.

Question: Do we have something to test SSL in CI pipeline ?

Please take a look: @wing328 @taxpon @frol @mbohlool @cbornet @kenjones-cisco @toumorokoshi

@wing328
Copy link
Contributor

wing328 commented Nov 27, 2017

Question: Do we have something to test SSL in CI pipeline ?

Nope I don't think so.

ca_certs = configuration.ssl_ca_cert
else:
# if not set certificate file, use Mozilla's root certificates.
ca_certs = certifi.where()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomplus shall we keep the default certificate certifi.where()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also handled by the tornado client it seems based on the link provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest versions of Tornado use certifi. But it's worth to mention that unstable version from master doesn't have this dependency, certificates from system will be used. A developer will still be able to add certifiy if she/he really needs to do it.


if hasattr(ssl, 'create_default_context'):
# require Python 2.7.9+, 3.4+
self.ssl_context = ssl.create_default_context()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the actual tornado client handle creating the ssl_context now, thereby making this redundant?

Copy link
Contributor Author

@tomplus tomplus Nov 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenjones-cisco
Copy link
Contributor

LGTM

@wing328 wing328 merged commit efe16fd into swagger-api:master Nov 28, 2017
@tomplus tomplus deleted the feature/python-tornado-ssl branch December 20, 2017 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants