prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  libeay32.dll and ssleay32.dll needs to be manually bundled to use PyQt5.QNetwork with SSL
  If you are having errors like:
  
  ```
  qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
  qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
  qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
  qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
  qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
  ```
  
  with PyInstaller and PyQt5 on Windows, you need to manually add libeay32.dll and ssleay32.dll from your PyQt5 site-packages (probably located somewhere in `PyQt5\Qt\bin\`) to your output dir or your frozen binary in a similar path.
  
  In my final specfile, it looks like this:
  
  ```python
  # -*- mode: python -*-
  
  block_cipher = None
  
  
  a = Analysis(['cddagl\\launcher.py'],
               pathex=['C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86\\', 'C:\\Users\\remy\\Projects\\CDDA-Game-Launcher'],
               binaries=[('C:\\Users\\remy\\VirtualEnvs\\CDDA-Game-Launcher\\lib\\site-packages\\PyQt5\\Qt\\bin\\libeay32.dll', 'PyQt5\\Qt\\bin'), ('C:\\Users\\remy\\VirtualEnvs\\CDDA-Game-Launcher\\lib\\site-packages\\PyQt5\\Qt\\bin\\ssleay32.dll', 'PyQt5\\Qt\\bin')],
               datas=[('alembic', 'alembic'), ('bin/updated.bat', '.'), ('data', 'data'), ('cddagl/resources', 'cddagl/resources'), ('C:\\Users\\remy\\AppData\\Local\\Programs\\Python\\Python36-32\\unrar.exe', '.'), ('cddagl/locale/en/LC_MESSAGES/cddagl.mo', 'cddagl/locale/en/LC_MESSAGES'), ('cddagl/locale/fr/LC_MESSAGES/cddagl.mo', 'cddagl/locale/fr/LC_MESSAGES'), ('cddagl/locale/it/LC_MESSAGES/cddagl.mo', 'cddagl/locale/it/LC_MESSAGES'), ('cddagl/locale/ru/LC_MESSAGES/cddagl.mo', 'cddagl/locale/ru/LC_MESSAGES')],
               hiddenimports=['lxml.cssselect', 'babel.numbers'],
               hookspath=[],
               runtime_hooks=[],
               excludes=[],
               win_no_prefer_redirects=False,
               win_private_assemblies=False,
               cipher=block_cipher)
  pyz = PYZ(a.pure, a.zipped_data,
               cipher=block_cipher)
  exe = EXE(pyz,
            a.scripts,
            a.binaries,
            a.zipfiles,
            a.datas,
            name='launcher',
            debug=True,
            strip=False,
            upx=False,
            runtime_tmpdir=None,
            console=True , icon='cddagl\\resources\\launcher.ico')
  ```
  
  I'm not sure how this can be improved, but this solution should work if you are having a similar issue. This was tested with **PyInstaller==3.4.dev0+1033a8770**
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `PyInstaller/hooks/hook-PyQt5.QtNetwork.py`
  Content:
  ```
  1 #-----------------------------------------------------------------------------
  2 # Copyright (c) 2013-2018, PyInstaller Development Team.
  3 #
  4 # Distributed under the terms of the GNU General Public License with exception
  5 # for distributing bootloader.
  6 #
  7 # The full license is in the file COPYING.txt, distributed with this software.
  8 #-----------------------------------------------------------------------------
  9 from PyInstaller.utils.hooks import add_qt5_dependencies
  10 
  11 hiddenimports, binaries, datas = add_qt5_dependencies(__file__)
  12
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/PyInstaller/hooks/hook-PyQt5.QtNetwork.py b/PyInstaller/hooks/hook-PyQt5.QtNetwork.py
  --- a/PyInstaller/hooks/hook-PyQt5.QtNetwork.py
  +++ b/PyInstaller/hooks/hook-PyQt5.QtNetwork.py
  @@ -6,6 +6,21 @@
   #
   # The full license is in the file COPYING.txt, distributed with this software.
   #-----------------------------------------------------------------------------
  -from PyInstaller.utils.hooks import add_qt5_dependencies
  +import os.path
  +
  +from PyInstaller.utils.hooks import pyqt5_library_info, add_qt5_dependencies
  +from PyInstaller.compat import is_win
   
   hiddenimports, binaries, datas = add_qt5_dependencies(__file__)
  +
  +# Add libraries needed for SSL. See issue #3520.
  +if is_win:
  +    rel_data_path = ['PyQt5', 'Qt', 'bin']
  +    binaries += [
  +        (os.path.join(pyqt5_library_info.location['BinariesPath'],
  +                      'libeay32.dll'),
  +         os.path.join(*rel_data_path)),
  +        (os.path.join(pyqt5_library_info.location['BinariesPath'],
  +                      'ssleay32.dll'),
  +         os.path.join(*rel_data_path))
  +    ]
  
verification_info: {"golden_diff": "diff --git a/PyInstaller/hooks/hook-PyQt5.QtNetwork.py b/PyInstaller/hooks/hook-PyQt5.QtNetwork.py\n--- a/PyInstaller/hooks/hook-PyQt5.QtNetwork.py\n+++ b/PyInstaller/hooks/hook-PyQt5.QtNetwork.py\n@@ -6,6 +6,21 @@\n #\n # The full license is in the file COPYING.txt, distributed with this software.\n #-----------------------------------------------------------------------------\n-from PyInstaller.utils.hooks import add_qt5_dependencies\n+import os.path\n+\n+from PyInstaller.utils.hooks import pyqt5_library_info, add_qt5_dependencies\n+from PyInstaller.compat import is_win\n \n hiddenimports, binaries, datas = add_qt5_dependencies(__file__)\n+\n+# Add libraries needed for SSL. See issue #3520.\n+if is_win:\n+    rel_data_path = ['PyQt5', 'Qt', 'bin']\n+    binaries += [\n+        (os.path.join(pyqt5_library_info.location['BinariesPath'],\n+                      'libeay32.dll'),\n+         os.path.join(*rel_data_path)),\n+        (os.path.join(pyqt5_library_info.location['BinariesPath'],\n+                      'ssleay32.dll'),\n+         os.path.join(*rel_data_path))\n+    ]\n", "issue": "libeay32.dll and ssleay32.dll needs to be manually bundled to use PyQt5.QNetwork with SSL\nIf you are having errors like:\r\n\r\n```\r\nqt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method\r\nqt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new\r\nqt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init\r\nqt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error\r\nqt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error\r\n```\r\n\r\nwith PyInstaller and PyQt5 on Windows, you need to manually add libeay32.dll and ssleay32.dll from your PyQt5 site-packages (probably located somewhere in `PyQt5\\Qt\\bin\\`) to your output dir or your frozen binary in a similar path.\r\n\r\nIn my final specfile, it looks like this:\r\n\r\n```python\r\n# -*- mode: python -*-\r\n\r\nblock_cipher = None\r\n\r\n\r\na = Analysis(['cddagl\\\\launcher.py'],\r\n             pathex=['C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\Redist\\\\ucrt\\\\DLLs\\\\x86\\\\', 'C:\\\\Users\\\\remy\\\\Projects\\\\CDDA-Game-Launcher'],\r\n             binaries=[('C:\\\\Users\\\\remy\\\\VirtualEnvs\\\\CDDA-Game-Launcher\\\\lib\\\\site-packages\\\\PyQt5\\\\Qt\\\\bin\\\\libeay32.dll', 'PyQt5\\\\Qt\\\\bin'), ('C:\\\\Users\\\\remy\\\\VirtualEnvs\\\\CDDA-Game-Launcher\\\\lib\\\\site-packages\\\\PyQt5\\\\Qt\\\\bin\\\\ssleay32.dll', 'PyQt5\\\\Qt\\\\bin')],\r\n             datas=[('alembic', 'alembic'), ('bin/updated.bat', '.'), ('data', 'data'), ('cddagl/resources', 'cddagl/resources'), ('C:\\\\Users\\\\remy\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python36-32\\\\unrar.exe', '.'), ('cddagl/locale/en/LC_MESSAGES/cddagl.mo', 'cddagl/locale/en/LC_MESSAGES'), ('cddagl/locale/fr/LC_MESSAGES/cddagl.mo', 'cddagl/locale/fr/LC_MESSAGES'), ('cddagl/locale/it/LC_MESSAGES/cddagl.mo', 'cddagl/locale/it/LC_MESSAGES'), ('cddagl/locale/ru/LC_MESSAGES/cddagl.mo', 'cddagl/locale/ru/LC_MESSAGES')],\r\n             hiddenimports=['lxml.cssselect', 'babel.numbers'],\r\n             hookspath=[],\r\n             runtime_hooks=[],\r\n             excludes=[],\r\n             win_no_prefer_redirects=False,\r\n             win_private_assemblies=False,\r\n             cipher=block_cipher)\r\npyz = PYZ(a.pure, a.zipped_data,\r\n             cipher=block_cipher)\r\nexe = EXE(pyz,\r\n          a.scripts,\r\n          a.binaries,\r\n          a.zipfiles,\r\n          a.datas,\r\n          name='launcher',\r\n          debug=True,\r\n          strip=False,\r\n          upx=False,\r\n          runtime_tmpdir=None,\r\n          console=True , icon='cddagl\\\\resources\\\\launcher.ico')\r\n```\r\n\r\nI'm not sure how this can be improved, but this solution should work if you are having a similar issue. This was tested with **PyInstaller==3.4.dev0+1033a8770**\n", "before_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2018, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License with exception\n# for distributing bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#-----------------------------------------------------------------------------\nfrom PyInstaller.utils.hooks import add_qt5_dependencies\n\nhiddenimports, binaries, datas = add_qt5_dependencies(__file__)\n", "path": "PyInstaller/hooks/hook-PyQt5.QtNetwork.py"}], "after_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2018, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License with exception\n# for distributing bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#-----------------------------------------------------------------------------\nimport os.path\n\nfrom PyInstaller.utils.hooks import pyqt5_library_info, add_qt5_dependencies\nfrom PyInstaller.compat import is_win\n\nhiddenimports, binaries, datas = add_qt5_dependencies(__file__)\n\n# Add libraries needed for SSL. See issue #3520.\nif is_win:\n    rel_data_path = ['PyQt5', 'Qt', 'bin']\n    binaries += [\n        (os.path.join(pyqt5_library_info.location['BinariesPath'],\n                      'libeay32.dll'),\n         os.path.join(*rel_data_path)),\n        (os.path.join(pyqt5_library_info.location['BinariesPath'],\n                      'ssleay32.dll'),\n         os.path.join(*rel_data_path))\n    ]\n", "path": "PyInstaller/hooks/hook-PyQt5.QtNetwork.py"}]}