Skip to content

Commit

Permalink
Increase RSA key size for PyPy3
Browse files Browse the repository at this point in the history
The PyPy builds are failing due to our good friend Twisted #9985 [1]:

    main function encountered error
    Traceback (most recent call last):
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks
        _inlineCallbacks(None, g, status)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
        result = g.send(result)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/treq/test/local_httpbin/child.py", line 175, in _serve_tls
        port = yield endpoint.listen(site)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/endpoints.py", line 1092, in listen
        interface=self._interface)
    --- <exception caught here> ---
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/treq/test/local_httpbin/child.py", line 175, in _serve_tls
        port = yield endpoint.listen(site)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/defer.py", line 122, in execute
        result = callable(*args, **kw)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/posixbase.py", line 521, in listenSSL
        tlsFactory = tls.TLSMemoryBIOFactory(contextFactory, False, factory)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/protocols/tls.py", line 773, in __init__
        contextFactory = _ContextFactoryToConnectionFactory(contextFactory)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/protocols/tls.py", line 651, in __init__
        oldStyleContextFactory.getContext()
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/_sslverify.py", line 1678, in getContext
        self._context = self._makeContext()
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/twisted/internet/_sslverify.py", line 1688, in _makeContext
        ctx.use_certificate(self.certificate)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/OpenSSL/SSL.py", line 865, in use_certificate
        _raise_current_error()
      File "/usr/lib/pypy3/lib_pypy/_functools.py", line 80, in __call__
        return self._func(*(self._args + fargs), **fkeywords)
      File ".../treq/.tox/pypy3-twisted_latest/site-packages/OpenSSL/_util.py", line 57, in exception_from_error_queue
        raise exception_type(errors)
    OpenSSL.SSL.Error: [('SSL routines', 'SSL_CTX_use_certificate', 'ee key too small')]

[1]: https://twistedmatrix.com/trac/ticket/9985
  • Loading branch information
twm committed Dec 23, 2020
1 parent b019e20 commit 6e698af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/treq/test/local_httpbin/child.py
Expand Up @@ -35,7 +35,7 @@
from .shared import _HTTPBinDescription


def _certificates_for_authority_and_server(service_identity, key_size=1024):
def _certificates_for_authority_and_server(service_identity, key_size=2048):
"""
Create a self-signed CA certificate and server certificate signed
by the CA.
Expand All @@ -44,8 +44,8 @@ def _certificates_for_authority_and_server(service_identity, key_size=1024):
:type service_identity: :py:class:`unicode`
:param key_size: (optional) The size of CA's and server's private
RSA keys. Defaults to 1024 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level as of 1.1.
RSA keys. Defaults to 2048 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level.
:type key_size: :py:class:`int`
:return: a 3-tuple of ``(certificate_authority_certificate,
Expand Down

0 comments on commit 6e698af

Please sign in to comment.