mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-10-21 11:08:44 +00:00
fixes #1422
This commit is contained in:
1 parent
3fa281625f
commit
a232472cbe
2 files changed
+11
-5
No files matched your search
@@ -2,15 +2,14 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
import certifi
|
||||||
from PyInstaller.utils.hooks import collect_data_files
|
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
# customtkinter ships JSON themes + assets that must be bundled
|
# customtkinter ships JSON themes + assets that must be bundled
|
||||||
import customtkinter
|
import customtkinter
|
||||||
ctk_path = os.path.dirname(customtkinter.__file__)
|
ctk_path = os.path.dirname(customtkinter.__file__)
|
||||||
certifi_datas = collect_data_files('certifi')
|
certifi_cafile = certifi.where()
|
||||||
|
|
||||||
_i18n_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'ui', 'i18n')
|
_i18n_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'ui', 'i18n')
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ a = Analysis(
|
|||||||
[os.path.join(os.path.dirname(SPEC), os.pardir, 'linux.py')],
|
[os.path.join(os.path.dirname(SPEC), os.pardir, 'linux.py')],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=appindicator_binaries,
|
binaries=appindicator_binaries,
|
||||||
datas=[(ctk_path, 'customtkinter/'), (_i18n_path, 'ui/i18n')] + certifi_datas,
|
datas=[(ctk_path, 'customtkinter/'), (_i18n_path, 'ui/i18n')],
|
||||||
hiddenimports=[
|
hiddenimports=[
|
||||||
'httpx',
|
'httpx',
|
||||||
'h2',
|
'h2',
|
||||||
@@ -63,6 +62,8 @@ a = Analysis(
|
|||||||
cipher=block_cipher,
|
cipher=block_cipher,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
a.datas += [('certifi/cacert.pem', certifi_cafile, 'DATA')]
|
||||||
|
|
||||||
_required_libraries = {
|
_required_libraries = {
|
||||||
'libglib-2.0.so.0', 'libgobject-2.0.so.0', 'libgio-2.0.so.0',
|
'libglib-2.0.so.0', 'libgobject-2.0.so.0', 'libgio-2.0.so.0',
|
||||||
'libgtk-3.so.0', 'libappindicator3.so.1',
|
'libgtk-3.so.0', 'libappindicator3.so.1',
|
||||||
|
|||||||
+6
-1
@@ -3,7 +3,9 @@ import urllib.request
|
|||||||
import http.client
|
import http.client
|
||||||
import ssl
|
import ssl
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
import certifi
|
import certifi
|
||||||
|
|
||||||
@@ -141,7 +143,10 @@ class _PinnedHTTPSHandler(urllib.request.HTTPSHandler):
|
|||||||
|
|
||||||
|
|
||||||
def create_ssl_context(*, check_hostname: bool = True) -> ssl.SSLContext:
|
def create_ssl_context(*, check_hostname: bool = True) -> ssl.SSLContext:
|
||||||
context = ssl.create_default_context(cafile=certifi.where())
|
bundle_dir = getattr(sys, '_MEIPASS', None)
|
||||||
|
cafile = (os.path.join(bundle_dir, 'certifi', 'cacert.pem')
|
||||||
|
if bundle_dir else certifi.where())
|
||||||
|
context = ssl.create_default_context(cafile=cafile)
|
||||||
context.load_default_certs()
|
context.load_default_certs()
|
||||||
context.check_hostname = check_hostname
|
context.check_hostname = check_hostname
|
||||||
return context
|
return context
|
||||||
|
|||||||
Reference in new issue
Block a user