mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-01-21 10:22:58 -08:00
3d378eb583
* Bump cheroot from 8.6.0 to 9.0.0 Bumps [cheroot](https://github.com/cherrypy/cheroot) from 8.6.0 to 9.0.0. - [Release notes](https://github.com/cherrypy/cheroot/releases) - [Changelog](https://github.com/cherrypy/cheroot/blob/main/CHANGES.rst) - [Commits](https://github.com/cherrypy/cheroot/compare/v8.6.0...v9.0.0) --- updated-dependencies: - dependency-name: cheroot dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update cheroot==9.0.0 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
"""Implementation of the SSL adapter base interface."""
|
|
|
|
from abc import ABCMeta, abstractmethod
|
|
|
|
|
|
class Adapter(metaclass=ABCMeta):
|
|
"""Base class for SSL driver library adapters.
|
|
|
|
Required methods:
|
|
|
|
* ``wrap(sock) -> (wrapped socket, ssl environ dict)``
|
|
* ``makefile(sock, mode='r', bufsize=DEFAULT_BUFFER_SIZE) ->
|
|
socket file object``
|
|
"""
|
|
|
|
@abstractmethod
|
|
def __init__(
|
|
self, certificate, private_key, certificate_chain=None,
|
|
ciphers=None,
|
|
):
|
|
"""Set up certificates, private key ciphers and reset context."""
|
|
self.certificate = certificate
|
|
self.private_key = private_key
|
|
self.certificate_chain = certificate_chain
|
|
self.ciphers = ciphers
|
|
self.context = None
|
|
|
|
@abstractmethod
|
|
def bind(self, sock):
|
|
"""Wrap and return the given socket."""
|
|
return sock
|
|
|
|
@abstractmethod
|
|
def wrap(self, sock):
|
|
"""Wrap and return the given socket, plus WSGI environ entries."""
|
|
raise NotImplementedError # pragma: no cover
|
|
|
|
@abstractmethod
|
|
def get_environ(self):
|
|
"""Return WSGI environ entries to be merged into each request."""
|
|
raise NotImplementedError # pragma: no cover
|
|
|
|
@abstractmethod
|
|
def makefile(self, sock, mode='r', bufsize=-1):
|
|
"""Return socket file object."""
|
|
raise NotImplementedError # pragma: no cover
|