[Bug 268043] devel/py-twisted regression with openssl port

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 28 Nov 2022 16:49:26 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268043

            Bug ID: 268043
           Summary: devel/py-twisted regression with openssl port
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: python@FreeBSD.org
          Reporter: dinoex@FreeBSD.org
             Flags: maintainer-feedback?(python@FreeBSD.org)
          Assignee: python@FreeBSD.org

Enviroment:

make.conf:
DEFAULT_VERSIONS+=      ssl=openssl

after upgrading matrix-synapse and its dependencies, server fails to start.

Logfile:
matrix pkg[26938]: py39-twisted upgraded: 22.4.0 -> 22.10.0
matrix root[37561]: /usr/local/etc/rc.d/synapse: WARNING: failed to start
synapse

Backtrace ... ends with
AttributeError: module 'OpenSSL.SSL' has no attribute 'TLS_METHOD'


Crude workaround, I changed 2 files to make synapse starting again.
This maybe not well tested.

vim /usr/local/lib/python3.9/site-packages/twisted/internet/_sslverify.py

line 1492
-self.method = SSL.TLS_METHOD
+self.method = SSL.TLSv1_2_METHOD

line 1807
- SSL.TLS_METHOD,
+ SSL.TLSv1_2_METHOD,

vim /usr/local/lib/python3.9/site-packages/twisted/internet/ssl.py"

line 95
-sslmethod=SSL.TLS_METHOD,
+sslmethod=SSL.TLSv1_2_METHOD,

line 145
-method = SSL.TLS_METHOD
+method = SSL.TLSv1_2_METHOD

Aa alternate solution may be adding:

${REINPLACE_CMD} -e 's|TLS_METHOD|TLSv1_2_METHOD|' ....

If you pick one of the ways, I will generate a build tested patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.