mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
19 lines
444 B
Python
19 lines
444 B
Python
import ssl
|
|
|
|
import aiohttp.connector as aiohttp_connector
|
|
import certifi
|
|
|
|
|
|
def configure_runtime_ca_bundle() -> None:
|
|
try:
|
|
ssl_context = ssl.create_default_context()
|
|
ssl_context.load_verify_locations(cafile=certifi.where())
|
|
|
|
if hasattr(aiohttp_connector, "_SSL_CONTEXT_VERIFIED"):
|
|
aiohttp_connector._SSL_CONTEXT_VERIFIED = ssl_context
|
|
except Exception:
|
|
return
|
|
|
|
|
|
configure_runtime_ca_bundle()
|