mirror of
https://git.wownero.com/wowlet/wowlet-backend.git
synced 2024-08-15 01:03:13 +00:00
TLS support for RPC nodes
This commit is contained in:
parent
a0bd7573ff
commit
24aeec9824
3 changed files with 20 additions and 11 deletions
|
@ -54,14 +54,14 @@ def collect_websocket(func):
|
|||
return wrapper
|
||||
|
||||
|
||||
async def httpget(url: str, json=True, timeout: int = 5, socks5: str = None, raise_for_status=True):
|
||||
async def httpget(url: str, json=True, timeout: int = 5, socks5: str = None, raise_for_status=True, verify_tls=True):
|
||||
headers = {"User-Agent": random_agent()}
|
||||
opts = {"timeout": aiohttp.ClientTimeout(total=timeout)}
|
||||
if socks5:
|
||||
opts['connector'] = ProxyConnector.from_url(socks5)
|
||||
|
||||
async with aiohttp.ClientSession(**opts) as session:
|
||||
async with session.get(url, headers=headers) as response:
|
||||
async with session.get(url, headers=headers, ssl=verify_tls) as response:
|
||||
if raise_for_status:
|
||||
response.raise_for_status()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue