We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Latest release broken on Ubuntu 22.04 - ImportError: libffi.so.7: cannot open shared object file: No such file or directory
#### Problem Description

https://askubuntu.com/questions/1286772/libffi-so-7-cannot-open-shared-object-file-no-such-file-or-directory

I don't think our users should do anything with their system to make the binary run, correct?

```
$ ./mitmdump 
Traceback (most recent call last):
  File "mitmdump", line 3, in <module>
  File "mitmproxy/tools/main.py", line 131, in mitmdump
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "mitmproxy/tools/dump.py", line 1, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "mitmproxy/addons/__init__.py", line 10, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "mitmproxy/addons/cut.py", line 14, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "pyperclip/__init__.py", line 52, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
  File "ctypes/__init__.py", line 8, in <module>
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
[50935] Failed to execute script 'mitmdump' due to unhandled exception!
```

#### Steps to reproduce the behavior:

1. `mitmdump`

Repros in a clean `docker run --rm -it ubuntu:22.04` as well

#### System Information

9.0.0 just downloaded (I cannot run `mitmdump --version` as it doesn't launch)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 import os
2 import re
3 from codecs import open
4 
5 from setuptools import find_packages, setup
6 
7 # Based on https://github.com/pypa/sampleproject/blob/main/setup.py
8 # and https://python-packaging-user-guide.readthedocs.org/
9 
10 here = os.path.abspath(os.path.dirname(__file__))
11 
12 with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
13     long_description = f.read()
14 long_description_content_type = "text/markdown"
15 
16 with open(os.path.join(here, "mitmproxy/version.py")) as f:
17     match = re.search(r'VERSION = "(.+?)"', f.read())
18     assert match
19     VERSION = match.group(1)
20 
21 setup(
22     name="mitmproxy",
23     version=VERSION,
24     description="An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.",
25     long_description=long_description,
26     long_description_content_type=long_description_content_type,
27     url="http://mitmproxy.org",
28     author="Aldo Cortesi",
29     author_email="aldo@corte.si",
30     license="MIT",
31     classifiers=[
32         "License :: OSI Approved :: MIT License",
33         "Development Status :: 5 - Production/Stable",
34         "Environment :: Console :: Curses",
35         "Operating System :: MacOS",
36         "Operating System :: POSIX",
37         "Operating System :: Microsoft :: Windows",
38         "Programming Language :: Python :: 3 :: Only",
39         "Programming Language :: Python :: 3.9",
40         "Programming Language :: Python :: 3.10",
41         "Programming Language :: Python :: 3.11",
42         "Programming Language :: Python :: Implementation :: CPython",
43         "Topic :: Security",
44         "Topic :: Internet :: WWW/HTTP",
45         "Topic :: Internet :: Proxy Servers",
46         "Topic :: System :: Networking :: Monitoring",
47         "Topic :: Software Development :: Testing",
48         "Typing :: Typed",
49     ],
50     project_urls={
51         "Documentation": "https://docs.mitmproxy.org/stable/",
52         "Source": "https://github.com/mitmproxy/mitmproxy/",
53         "Tracker": "https://github.com/mitmproxy/mitmproxy/issues",
54     },
55     packages=find_packages(
56         include=[
57             "mitmproxy",
58             "mitmproxy.*",
59         ]
60     ),
61     include_package_data=True,
62     entry_points={
63         "console_scripts": [
64             "mitmproxy = mitmproxy.tools.main:mitmproxy",
65             "mitmdump = mitmproxy.tools.main:mitmdump",
66             "mitmweb = mitmproxy.tools.main:mitmweb",
67         ],
68         "pyinstaller40": [
69             "hook-dirs = mitmproxy.utils.pyinstaller:hook_dirs",
70         ]
71     },
72     python_requires=">=3.9",
73     # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires
74     # It is not considered best practice to use install_requires to pin dependencies to specific versions.
75     install_requires=[
76         "asgiref>=3.2.10,<3.6",
77         "Brotli>=1.0,<1.1",
78         "certifi>=2019.9.11",  # no semver here - this should always be on the last release!
79         "cryptography>=38.0,<38.1",
80         "flask>=1.1.1,<2.3",
81         "h11>=0.11,<0.15",
82         "h2>=4.1,<5",
83         "hyperframe>=6.0,<7",
84         "kaitaistruct>=0.10,<0.11",
85         "ldap3>=2.8,<2.10",
86         "mitmproxy_wireguard>=0.1.6,<0.2",
87         "msgpack>=1.0.0, <1.1.0",
88         "passlib>=1.6.5, <1.8",
89         "protobuf>=3.14,<5",
90         "pyOpenSSL>=22.1,<22.2",
91         "pyparsing>=2.4.2,<3.1",
92         "pyperclip>=1.6.0,<1.9",
93         "ruamel.yaml>=0.16,<0.18",
94         "sortedcontainers>=2.3,<2.5",
95         "tornado>=6.1,<7",
96         "urwid>=2.1.1,<2.2",
97         "wsproto>=1.0,<1.3",
98         "publicsuffix2>=2.20190812,<3",
99         "zstandard>=0.11,<0.20",
100         "typing-extensions>=4.3,<4.5; python_version<'3.10'",
101     ],
102     extras_require={
103         ':sys_platform == "win32"': [
104             "pydivert>=2.0.3,<2.2",
105         ],
106         "dev": [
107             "click>=7.0,<8.2",
108             "hypothesis>=5.8,<7",
109             "parver>=0.1,<2.0",
110             "pdoc>=4.0.0",
111             "pyinstaller==5.6.1",
112             "pytest-asyncio>=0.17,<0.21",
113             "pytest-cov>=2.7.1,<4.1",
114             "pytest-timeout>=1.3.3,<2.2",
115             "pytest-xdist>=2.1.0,<3.1",
116             "pytest>=6.1.0,<8",
117             "requests>=2.9.1,<3",
118             "tox>=3.5,<4",
119             "wheel>=0.36.2,<0.39",
120         ],
121     },
122 )
123
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -108,7 +108,7 @@
             "hypothesis>=5.8,<7",
             "parver>=0.1,<2.0",
             "pdoc>=4.0.0",
-            "pyinstaller==5.6.1",
+            "pyinstaller==5.5",
             "pytest-asyncio>=0.17,<0.21",
             "pytest-cov>=2.7.1,<4.1",
             "pytest-timeout>=1.3.3,<2.2",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -108,7 +108,7 @@\n             \"hypothesis>=5.8,<7\",\n             \"parver>=0.1,<2.0\",\n             \"pdoc>=4.0.0\",\n-            \"pyinstaller==5.6.1\",\n+            \"pyinstaller==5.5\",\n             \"pytest-asyncio>=0.17,<0.21\",\n             \"pytest-cov>=2.7.1,<4.1\",\n             \"pytest-timeout>=1.3.3,<2.2\",\n", "issue": "Latest release broken on Ubuntu 22.04 - ImportError: libffi.so.7: cannot open shared object file: No such file or directory\n#### Problem Description\r\n\r\nhttps://askubuntu.com/questions/1286772/libffi-so-7-cannot-open-shared-object-file-no-such-file-or-directory\r\n\r\nI don't think our users should do anything with their system to make the binary run, correct?\r\n\r\n```\r\n$ ./mitmdump \r\nTraceback (most recent call last):\r\n  File \"mitmdump\", line 3, in <module>\r\n  File \"mitmproxy/tools/main.py\", line 131, in mitmdump\r\n  File \"PyInstaller/loader/pyimod02_importers.py\", line 499, in exec_module\r\n  File \"mitmproxy/tools/dump.py\", line 1, in <module>\r\n  File \"PyInstaller/loader/pyimod02_importers.py\", line 499, in exec_module\r\n  File \"mitmproxy/addons/__init__.py\", line 10, in <module>\r\n  File \"PyInstaller/loader/pyimod02_importers.py\", line 499, in exec_module\r\n  File \"mitmproxy/addons/cut.py\", line 14, in <module>\r\n  File \"PyInstaller/loader/pyimod02_importers.py\", line 499, in exec_module\r\n  File \"pyperclip/__init__.py\", line 52, in <module>\r\n  File \"PyInstaller/loader/pyimod02_importers.py\", line 499, in exec_module\r\n  File \"ctypes/__init__.py\", line 8, in <module>\r\nImportError: libffi.so.7: cannot open shared object file: No such file or directory\r\n[50935] Failed to execute script 'mitmdump' due to unhandled exception!\r\n```\r\n\r\n#### Steps to reproduce the behavior:\r\n\r\n1. `mitmdump`\r\n\r\nRepros in a clean `docker run --rm -it ubuntu:22.04` as well\r\n\r\n#### System Information\r\n\r\n9.0.0 just downloaded (I cannot run `mitmdump --version` as it doesn't launch)\r\n\n", "before_files": [{"content": "import os\nimport re\nfrom codecs import open\n\nfrom setuptools import find_packages, setup\n\n# Based on https://github.com/pypa/sampleproject/blob/main/setup.py\n# and https://python-packaging-user-guide.readthedocs.org/\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nwith open(os.path.join(here, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\nlong_description_content_type = \"text/markdown\"\n\nwith open(os.path.join(here, \"mitmproxy/version.py\")) as f:\n    match = re.search(r'VERSION = \"(.+?)\"', f.read())\n    assert match\n    VERSION = match.group(1)\n\nsetup(\n    name=\"mitmproxy\",\n    version=VERSION,\n    description=\"An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.\",\n    long_description=long_description,\n    long_description_content_type=long_description_content_type,\n    url=\"http://mitmproxy.org\",\n    author=\"Aldo Cortesi\",\n    author_email=\"aldo@corte.si\",\n    license=\"MIT\",\n    classifiers=[\n        \"License :: OSI Approved :: MIT License\",\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Console :: Curses\",\n        \"Operating System :: MacOS\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Programming Language :: Python :: 3.11\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Topic :: Security\",\n        \"Topic :: Internet :: WWW/HTTP\",\n        \"Topic :: Internet :: Proxy Servers\",\n        \"Topic :: System :: Networking :: Monitoring\",\n        \"Topic :: Software Development :: Testing\",\n        \"Typing :: Typed\",\n    ],\n    project_urls={\n        \"Documentation\": \"https://docs.mitmproxy.org/stable/\",\n        \"Source\": \"https://github.com/mitmproxy/mitmproxy/\",\n        \"Tracker\": \"https://github.com/mitmproxy/mitmproxy/issues\",\n    },\n    packages=find_packages(\n        include=[\n            \"mitmproxy\",\n            \"mitmproxy.*\",\n        ]\n    ),\n    include_package_data=True,\n    entry_points={\n        \"console_scripts\": [\n            \"mitmproxy = mitmproxy.tools.main:mitmproxy\",\n            \"mitmdump = mitmproxy.tools.main:mitmdump\",\n            \"mitmweb = mitmproxy.tools.main:mitmweb\",\n        ],\n        \"pyinstaller40\": [\n            \"hook-dirs = mitmproxy.utils.pyinstaller:hook_dirs\",\n        ]\n    },\n    python_requires=\">=3.9\",\n    # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires\n    # It is not considered best practice to use install_requires to pin dependencies to specific versions.\n    install_requires=[\n        \"asgiref>=3.2.10,<3.6\",\n        \"Brotli>=1.0,<1.1\",\n        \"certifi>=2019.9.11\",  # no semver here - this should always be on the last release!\n        \"cryptography>=38.0,<38.1\",\n        \"flask>=1.1.1,<2.3\",\n        \"h11>=0.11,<0.15\",\n        \"h2>=4.1,<5\",\n        \"hyperframe>=6.0,<7\",\n        \"kaitaistruct>=0.10,<0.11\",\n        \"ldap3>=2.8,<2.10\",\n        \"mitmproxy_wireguard>=0.1.6,<0.2\",\n        \"msgpack>=1.0.0, <1.1.0\",\n        \"passlib>=1.6.5, <1.8\",\n        \"protobuf>=3.14,<5\",\n        \"pyOpenSSL>=22.1,<22.2\",\n        \"pyparsing>=2.4.2,<3.1\",\n        \"pyperclip>=1.6.0,<1.9\",\n        \"ruamel.yaml>=0.16,<0.18\",\n        \"sortedcontainers>=2.3,<2.5\",\n        \"tornado>=6.1,<7\",\n        \"urwid>=2.1.1,<2.2\",\n        \"wsproto>=1.0,<1.3\",\n        \"publicsuffix2>=2.20190812,<3\",\n        \"zstandard>=0.11,<0.20\",\n        \"typing-extensions>=4.3,<4.5; python_version<'3.10'\",\n    ],\n    extras_require={\n        ':sys_platform == \"win32\"': [\n            \"pydivert>=2.0.3,<2.2\",\n        ],\n        \"dev\": [\n            \"click>=7.0,<8.2\",\n            \"hypothesis>=5.8,<7\",\n            \"parver>=0.1,<2.0\",\n            \"pdoc>=4.0.0\",\n            \"pyinstaller==5.6.1\",\n            \"pytest-asyncio>=0.17,<0.21\",\n            \"pytest-cov>=2.7.1,<4.1\",\n            \"pytest-timeout>=1.3.3,<2.2\",\n            \"pytest-xdist>=2.1.0,<3.1\",\n            \"pytest>=6.1.0,<8\",\n            \"requests>=2.9.1,<3\",\n            \"tox>=3.5,<4\",\n            \"wheel>=0.36.2,<0.39\",\n        ],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "import os\nimport re\nfrom codecs import open\n\nfrom setuptools import find_packages, setup\n\n# Based on https://github.com/pypa/sampleproject/blob/main/setup.py\n# and https://python-packaging-user-guide.readthedocs.org/\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nwith open(os.path.join(here, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\nlong_description_content_type = \"text/markdown\"\n\nwith open(os.path.join(here, \"mitmproxy/version.py\")) as f:\n    match = re.search(r'VERSION = \"(.+?)\"', f.read())\n    assert match\n    VERSION = match.group(1)\n\nsetup(\n    name=\"mitmproxy\",\n    version=VERSION,\n    description=\"An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.\",\n    long_description=long_description,\n    long_description_content_type=long_description_content_type,\n    url=\"http://mitmproxy.org\",\n    author=\"Aldo Cortesi\",\n    author_email=\"aldo@corte.si\",\n    license=\"MIT\",\n    classifiers=[\n        \"License :: OSI Approved :: MIT License\",\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Console :: Curses\",\n        \"Operating System :: MacOS\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Programming Language :: Python :: 3.11\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Topic :: Security\",\n        \"Topic :: Internet :: WWW/HTTP\",\n        \"Topic :: Internet :: Proxy Servers\",\n        \"Topic :: System :: Networking :: Monitoring\",\n        \"Topic :: Software Development :: Testing\",\n        \"Typing :: Typed\",\n    ],\n    project_urls={\n        \"Documentation\": \"https://docs.mitmproxy.org/stable/\",\n        \"Source\": \"https://github.com/mitmproxy/mitmproxy/\",\n        \"Tracker\": \"https://github.com/mitmproxy/mitmproxy/issues\",\n    },\n    packages=find_packages(\n        include=[\n            \"mitmproxy\",\n            \"mitmproxy.*\",\n        ]\n    ),\n    include_package_data=True,\n    entry_points={\n        \"console_scripts\": [\n            \"mitmproxy = mitmproxy.tools.main:mitmproxy\",\n            \"mitmdump = mitmproxy.tools.main:mitmdump\",\n            \"mitmweb = mitmproxy.tools.main:mitmweb\",\n        ],\n        \"pyinstaller40\": [\n            \"hook-dirs = mitmproxy.utils.pyinstaller:hook_dirs\",\n        ]\n    },\n    python_requires=\">=3.9\",\n    # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires\n    # It is not considered best practice to use install_requires to pin dependencies to specific versions.\n    install_requires=[\n        \"asgiref>=3.2.10,<3.6\",\n        \"Brotli>=1.0,<1.1\",\n        \"certifi>=2019.9.11\",  # no semver here - this should always be on the last release!\n        \"cryptography>=38.0,<38.1\",\n        \"flask>=1.1.1,<2.3\",\n        \"h11>=0.11,<0.15\",\n        \"h2>=4.1,<5\",\n        \"hyperframe>=6.0,<7\",\n        \"kaitaistruct>=0.10,<0.11\",\n        \"ldap3>=2.8,<2.10\",\n        \"mitmproxy_wireguard>=0.1.6,<0.2\",\n        \"msgpack>=1.0.0, <1.1.0\",\n        \"passlib>=1.6.5, <1.8\",\n        \"protobuf>=3.14,<5\",\n        \"pyOpenSSL>=22.1,<22.2\",\n        \"pyparsing>=2.4.2,<3.1\",\n        \"pyperclip>=1.6.0,<1.9\",\n        \"ruamel.yaml>=0.16,<0.18\",\n        \"sortedcontainers>=2.3,<2.5\",\n        \"tornado>=6.1,<7\",\n        \"urwid>=2.1.1,<2.2\",\n        \"wsproto>=1.0,<1.3\",\n        \"publicsuffix2>=2.20190812,<3\",\n        \"zstandard>=0.11,<0.20\",\n        \"typing-extensions>=4.3,<4.5; python_version<'3.10'\",\n    ],\n    extras_require={\n        ':sys_platform == \"win32\"': [\n            \"pydivert>=2.0.3,<2.2\",\n        ],\n        \"dev\": [\n            \"click>=7.0,<8.2\",\n            \"hypothesis>=5.8,<7\",\n            \"parver>=0.1,<2.0\",\n            \"pdoc>=4.0.0\",\n            \"pyinstaller==5.5\",\n            \"pytest-asyncio>=0.17,<0.21\",\n            \"pytest-cov>=2.7.1,<4.1\",\n            \"pytest-timeout>=1.3.3,<2.2\",\n            \"pytest-xdist>=2.1.0,<3.1\",\n            \"pytest>=6.1.0,<8\",\n            \"requests>=2.9.1,<3\",\n            \"tox>=3.5,<4\",\n            \"wheel>=0.36.2,<0.39\",\n        ],\n    },\n)\n", "path": "setup.py"}]}