Spaces:
Running

andervier commited on
Commit
e8bca86
·
1 Parent(s): 297b450

fix: add certifi for SSL verification in Docker container

Browse files
Files changed (2) hide show
  1. main.py +3 -2
  2. requirements.txt +1 -0
main.py CHANGED
@@ -5,6 +5,7 @@ import httpx
5
  import asyncio
6
  import time
7
  import re
 
8
  import jwt
9
  from jwt import PyJWKClient
10
 
@@ -86,7 +87,7 @@ async def fetch_bcv() -> dict:
86
  "Accept-Language": "es-VE,es;q=0.9",
87
  }
88
 
89
- async with httpx.AsyncClient(timeout=15, follow_redirects=True) as client:
90
  response = await client.get("https://www.bcv.org.ve/", headers=headers)
91
  response.raise_for_status()
92
 
@@ -141,7 +142,7 @@ async def fetch_p2p() -> dict:
141
  "classifies": ["mass", "profession"],
142
  }
143
 
144
- async with httpx.AsyncClient(timeout=10) as client:
145
  buy_res, sell_res = await asyncio.gather(
146
  client.post(
147
  "https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search",
 
5
  import asyncio
6
  import time
7
  import re
8
+ import certifi
9
  import jwt
10
  from jwt import PyJWKClient
11
 
 
87
  "Accept-Language": "es-VE,es;q=0.9",
88
  }
89
 
90
+ async with httpx.AsyncClient(timeout=15, follow_redirects=True, verify=certifi.where()) as client:
91
  response = await client.get("https://www.bcv.org.ve/", headers=headers)
92
  response.raise_for_status()
93
 
 
142
  "classifies": ["mass", "profession"],
143
  }
144
 
145
+ async with httpx.AsyncClient(timeout=10, verify=certifi.where()) as client:
146
  buy_res, sell_res = await asyncio.gather(
147
  client.post(
148
  "https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search",
requirements.txt CHANGED
@@ -4,3 +4,4 @@ httpx==0.28.1
4
  PyJWT[crypto]==2.10.1
5
  beautifulsoup4==4.12.3
6
  lxml==5.3.0
 
 
4
  PyJWT[crypto]==2.10.1
5
  beautifulsoup4==4.12.3
6
  lxml==5.3.0
7
+ certifi==2024.12.14