Skip to content

docs: improve pyopenssl docs in deploy.rst#2031

Open
ktdreyer wants to merge 1 commit intocherrypy:mainfrom
ktdreyer:doc-pyopenssl
Open

docs: improve pyopenssl docs in deploy.rst#2031
ktdreyer wants to merge 1 commit intocherrypy:mainfrom
ktdreyer:doc-pyopenssl

Conversation

@ktdreyer
Copy link
Copy Markdown

Update the docs to say that builtin is now the default backend.

Give Python examples of how to set both backends (builtin and pyopenssl.)

What kind of change does this PR introduce?

  • bug fix
  • feature
  • docs update
  • tests/coverage improvement
  • refactoring
  • other

Update the docs to say that "builtin" is now the default backend.

Give Python examples of how to set both backends ("builtin" and
"pyopenssl".)
@ktdreyer
Copy link
Copy Markdown
Author

With the simple "hello world" application, I get better performance with the pyopenssl backend (testing in a container on localhost) so I think that's the main reason users would choose pyopenssl now. Is that right?

@webknjaz
Copy link
Copy Markdown
Member

I'm not sure. I think many people just put it behind a reverse proxy instead of handling TLS in-app. I have a feeling that the pyopenssl integration is a bit more buggy as of the last Cheroot release. I dream of having enough time to refactor both adapters..

@ktdreyer
Copy link
Copy Markdown
Author

Would you please merge this? It makes it much clearer that builtin is the default.

Comment thread docs/deploy.rst

.. code-block:: bash

$ pip install cython, pyOpenSSL
Copy link
Copy Markdown
Member

@webknjaz webknjaz Jan 21, 2025

Choose a reason for hiding this comment

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

Does this syntax with a comma event work? Also, it's unlikely to have any effect these days.

Comment thread docs/deploy.rst

cherrypy.server.ssl_module = 'builtin'

b) *pyOpenSSL*. Because python did not have a built-in SSL library when CherryPy was first created, the default setting is to use pyOpenSSL. To use it you'll need to install it (we could recommend you install `cython <http://cython.org/>`_ first):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think, it'd be good to keep the historic reference regarding why it was added. Also, I'm not sure if the performance bit is noticeable. Technically, both are implemented as C-extensions linking against some OpenSSL version.
I'd drop the mention of Cython too since pyOpenSSL is a pure-python wheel and cyptography ships pre-built wheels — one would have to go out of their way to force it to build from sdist, which would pick up an isolated version of Cython anyway.

Comment thread docs/deploy.rst
3. Decide whether you want to use python's built-in SSL library, or the pyOpenSSL library. CherryPy supports either.

a) *Built-in.* To use python's built-in SSL, add the following line to your CherryPy config:
a) *Built-in.* CherryPy uses Python's built-in SSL by default. To set it explicitly, set this line in your CherryPy config:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems like there's at least one place where builtin is not the default:

Plus, there's another place that would need to be cleaned up for this docs change to make sense:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants