mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
get path from certifi and set it globally
This commit is contained in:
parent
deffdebf6f
commit
7e98879fd3
1 changed files with 11 additions and 6 deletions
17
start.py
17
start.py
|
|
@ -102,6 +102,7 @@ from pathlib import Path
|
|||
import platform
|
||||
|
||||
import blessed
|
||||
import certifi
|
||||
|
||||
|
||||
term = blessed.Terminal()
|
||||
|
|
@ -124,6 +125,16 @@ def _print(message: str):
|
|||
print("{}{}".format(term.tan(" . "), message[4:]))
|
||||
|
||||
|
||||
# if SSL_CERT_FILE is not set prior to OpenPype launch, we set it to point
|
||||
# to certifi bundle to make sure we have reasonably new CA certificates.
|
||||
if os.getenv("SSL_CERT_FILE") and \
|
||||
os.getenv("SSL_CERT_FILE") != certifi.where():
|
||||
_print("--- your system is set to use custom CA certificate bundle.")
|
||||
else:
|
||||
ssl_cert_file = certifi.where()
|
||||
os.environ["SSL_CERT_FILE"] = ssl_cert_file
|
||||
|
||||
|
||||
# OPENPYPE_ROOT is variable pointing to build (or code) directory
|
||||
# WARNING `OPENPYPE_ROOT` must be defined before igniter import
|
||||
# - igniter changes cwd which cause that filepath of this script won't lead
|
||||
|
|
@ -134,12 +145,6 @@ if not getattr(sys, 'frozen', False):
|
|||
else:
|
||||
OPENPYPE_ROOT = os.path.dirname(sys.executable)
|
||||
|
||||
if os.getenv("SSL_CERT_FILE"):
|
||||
_print("--- your system is set to use custom CA certificate bundle.")
|
||||
if not os.getenv("SSL_CERT_FILE") and platform.system().lower() == "darwin": # noqa: E501
|
||||
ssl_cert_file = Path(OPENPYPE_ROOT) / "dependencies" / "certifi" / "cacert.pem" # noqa: E501
|
||||
os.environ["SSL_CERT_FILE"] = ssl_cert_file.as_posix()
|
||||
|
||||
# add dependencies folder to sys.pat for frozen code
|
||||
frozen_libs = os.path.normpath(
|
||||
os.path.join(OPENPYPE_ROOT, "dependencies")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue