Skip to content

Commit

Permalink
linux: add truststore as a dependency
Browse files Browse the repository at this point in the history
Because Linux distributions don't have an 'universal' path for the
system certificate store, bundling libssl built on distro A might not
work on distro B, because distros tend to change path to the
certificate store at build time.

This means that creating a PyInstaller package on Ubuntu will include
the libssl built there, and if you try to run this package on a
different distro (e.g. Arch Linux), any attempt to create an SSL
connection will fail, because Arch Linux has a different path for the
certificate store than Ubuntu.

This issue is usually worked around by bundling certificates with the
app (usually using certifi), and then pointing the SSL_CERT_FILE
environment to it.

However, truststore seems to be a better alternative, since it tries to
use the certificate store from the system instead.

The list of benefits are listed on the project's page on GitHub:

https://github.com/sethmlarson/truststore
  • Loading branch information
guihkx authored and DevilXD committed Jun 11, 2023
1 parent 7c1e7b0 commit e31dcd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
if sys.platform == "win32":
import win32gui

if sys.platform == "linux" and sys.version_info >= (3, 10):
import truststore
truststore.inject_into_ssl()

from translate import _
from twitch import Twitch
from settings import Settings
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PyGObject; sys_platform == "linux" # required for better system tray support on
# undetected-chromedriver
# this is installed only on windows
pywin32; sys_platform == "win32"
truststore; sys_platform == "linux" and python_version >= "3.10"

0 comments on commit e31dcd8

Please sign in to comment.