fix: bundle certifi CA per SSL su Windows/macOS + bump v1.8.5
- requirements.txt: certifi come dep esplicita - main.py: setta SSL_CERT_FILE/REQUESTS_CA_BUNDLE su certifi.where() al boot - build_windows.py + build_macos.py: --collect-data certifi nel PyInstaller Bugfix: senza certifi bundlato, le chiamate HTTPS dal build Windows falliscono con CERTIFICATE_VERIFY_FAILED (attivazione licenza impossibile).
This commit is contained in:
1 parent
c7dfe95890
commit
c4e6d6e322
5 files changed
+21
-1
No files matched your search
@@ -226,6 +226,8 @@ def run_pyinstaller():
|
|||||||
"--hidden-import", "webview.platforms.cocoa",
|
"--hidden-import", "webview.platforms.cocoa",
|
||||||
"--hidden-import", "requests",
|
"--hidden-import", "requests",
|
||||||
"--collect-all", "mutagen",
|
"--collect-all", "mutagen",
|
||||||
|
# certifi ha cacert.pem necessario per SSL/HTTPS
|
||||||
|
"--collect-data", "certifi",
|
||||||
# Binari bundled (yt-dlp, ffmpeg, ffprobe + dylibs)
|
# Binari bundled (yt-dlp, ffmpeg, ffprobe + dylibs)
|
||||||
*add_binaries,
|
*add_binaries,
|
||||||
# Entry point
|
# Entry point
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ def run_pyinstaller():
|
|||||||
"--collect-all", "pythonnet",
|
"--collect-all", "pythonnet",
|
||||||
"--collect-all", "clr_loader",
|
"--collect-all", "clr_loader",
|
||||||
"--collect-all", "mutagen",
|
"--collect-all", "mutagen",
|
||||||
|
# certifi ha il file dati cacert.pem necessario per SSL/HTTPS
|
||||||
|
"--collect-data", "certifi",
|
||||||
# collect-data prende anche i file .json/.dll non-Python che
|
# collect-data prende anche i file .json/.dll non-Python che
|
||||||
# collect-all potrebbe saltare (Python.Runtime.runtimeconfig.json
|
# collect-all potrebbe saltare (Python.Runtime.runtimeconfig.json
|
||||||
# in particolare).
|
# in particolare).
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
VERSION = "v1.8.4"
|
VERSION = "v1.8.5"
|
||||||
|
|
||||||
|
|
||||||
APP_NAME = "MusicTools"
|
APP_NAME = "MusicTools"
|
||||||
|
|||||||
@@ -4,6 +4,21 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# Fix SSL CA bundle: quando l'app e' frozen (PyInstaller) i moduli
|
||||||
|
# ssl e requests non trovano nessun CA bundle di default -> tutte
|
||||||
|
# le chiamate HTTPS falliscono con CERTIFICATE_VERIFY_FAILED.
|
||||||
|
# Puntiamo esplicitamente al bundle di certifi (che il build script
|
||||||
|
# include via `--collect-data certifi`).
|
||||||
|
# ============================================================
|
||||||
|
try:
|
||||||
|
import certifi as _certifi
|
||||||
|
_ca_bundle = _certifi.where()
|
||||||
|
os.environ.setdefault("SSL_CERT_FILE", _ca_bundle)
|
||||||
|
os.environ.setdefault("REQUESTS_CA_BUNDLE", _ca_bundle)
|
||||||
|
except Exception as _e:
|
||||||
|
print(f"[bootstrap] certifi setup failed: {_e}")
|
||||||
|
|
||||||
# Windows: forza il caricamento del runtime pythonnet PRIMA di importare
|
# Windows: forza il caricamento del runtime pythonnet PRIMA di importare
|
||||||
# webview. Con PyInstaller il lazy-loader fallisce con
|
# webview. Con PyInstaller il lazy-loader fallisce con
|
||||||
# "Failed to resolve Python.Runtime.Loader.Initialize" perche'
|
# "Failed to resolve Python.Runtime.Loader.Initialize" perche'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
pywebview>=5.0
|
pywebview>=5.0
|
||||||
requests>=2.31.0
|
requests>=2.31.0
|
||||||
|
certifi>=2024.0.0
|
||||||
yt-dlp>=2024.0.0
|
yt-dlp>=2024.0.0
|
||||||
mutagen>=1.47.0
|
mutagen>=1.47.0
|
||||||
pyobjc-core>=10.0 ; sys_platform == "darwin"
|
pyobjc-core>=10.0 ; sys_platform == "darwin"
|
||||||
|
|||||||
Reference in new issue
Block a user