PyPtt 1.2.9__tar.gz → 1.2.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyptt-1.2.9 → pyptt-1.2.10}/PKG-INFO +1 -1
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/__init__.py +1 -1
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/connect_core.py +14 -10
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/ssl_config.py +0 -1
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt.egg-info/PKG-INFO +1 -1
- {pyptt-1.2.9 → pyptt-1.2.10}/LICENSE +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/MANIFEST.in +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/PTT.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_bucket.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_call_status.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_change_pw.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_comment.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_del_post.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_board_info.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_board_list.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_bottom_post_list.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_favourite_board.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_newest_index.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_post.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_post_index.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_time.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_get_user.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_give_money.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_has_new_mail.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_loginout.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_mail.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_mark_post.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_post.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_reply_post.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_search_user.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_set_board_title.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/_api_util.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/check_value.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/command.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/config.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/data_type.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/exceptions.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/i18n.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/lang_en_US.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/lang_zh_TW.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/lib_util.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/log.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/screens.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/service.py +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/ssl/cert.pem +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt/ssl/key.pem +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt.egg-info/SOURCES.txt +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt.egg-info/dependency_links.txt +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt.egg-info/requires.txt +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/PyPtt.egg-info/top_level.txt +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/README.md +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/setup.cfg +0 -0
- {pyptt-1.2.9 → pyptt-1.2.10}/setup.py +0 -0
|
@@ -4,6 +4,7 @@ import asyncio
|
|
|
4
4
|
import os.path
|
|
5
5
|
import ssl
|
|
6
6
|
import telnetlib
|
|
7
|
+
import tempfile
|
|
7
8
|
import threading
|
|
8
9
|
import time
|
|
9
10
|
import traceback
|
|
@@ -25,24 +26,27 @@ from . import ssl_config
|
|
|
25
26
|
|
|
26
27
|
websockets.http.USER_AGENT += f' PyPtt/{PyPtt.__version__}'
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
ssl_context = ssl.create_default_context()
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
def ssl_init():
|
|
32
|
-
if not os.path.exists(f'{_script_path}/ssl'):
|
|
33
|
-
os.mkdir(f'{_script_path}/ssl')
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
cert_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pem')
|
|
35
|
+
cert_file.write(ssl_config.cert.encode('utf-8'))
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
key_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pem')
|
|
38
|
+
key_file.write(ssl_config.key.encode('utf-8'))
|
|
40
39
|
|
|
40
|
+
cert_file.close()
|
|
41
|
+
key_file.close()
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
ssl_context.load_cert_chain(certfile=cert_file.name, keyfile=key_file.name)
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
os.unlink(cert_file.name)
|
|
46
|
+
os.unlink(key_file.name)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
ssl_init()
|
|
46
50
|
ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
|
|
47
51
|
|
|
48
52
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|