mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-09-21 09:48:27 +03:00
use certifi for tls connections, fixes #1348
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import ssl
|
||||
import certifi
|
||||
import logging
|
||||
import base64
|
||||
import struct
|
||||
@@ -21,8 +22,8 @@ _st_BBQ4s = struct.Struct('>BBQ4s')
|
||||
_st_H = struct.Struct('>H')
|
||||
_st_Q = struct.Struct('>Q')
|
||||
|
||||
_ssl_ctx = ssl.create_default_context()
|
||||
_ssl_ctx_fronting = ssl.create_default_context()
|
||||
_ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
||||
_ssl_ctx_fronting = ssl.create_default_context(cafile=certifi.where())
|
||||
_ssl_ctx_fronting.check_hostname = False
|
||||
|
||||
class WsHandshakeError(Exception):
|
||||
@@ -290,4 +291,4 @@ class RawWebSocket:
|
||||
payload = await self.reader.readexactly(length)
|
||||
return opcode, _xor_mask(payload, mask_key), fin
|
||||
payload = await self.reader.readexactly(length)
|
||||
return opcode, payload, fin
|
||||
return opcode, payload, fin
|
||||
|
||||
Reference in New Issue
Block a user