Fix SSL handshake in Google OAuth callback: use httpx native certificate handling instead of custom SSL context
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
dvirlabs 2026-05-14 18:44:03 +03:00
parent 685d33c4fe
commit b559799802

View File

@ -17,7 +17,6 @@ import shutil
from pathlib import Path from pathlib import Path
from dotenv import load_dotenv from dotenv import load_dotenv
import httpx import httpx
import ssl
import certifi import certifi
from urllib.parse import urlencode, quote from urllib.parse import urlencode, quote
from datetime import timezone, timedelta from datetime import timezone, timedelta
@ -1134,8 +1133,7 @@ async def google_callback(
raise HTTPException(status_code=500, detail="Google OAuth credentials not configured") raise HTTPException(status_code=500, detail="Google OAuth credentials not configured")
try: try:
ssl_ctx = ssl.create_default_context(cafile=certifi.where()) async with httpx.AsyncClient(verify=certifi.where()) as client_http:
async with httpx.AsyncClient(verify=ssl_ctx) as client_http:
# Exchange authorization code for access token # Exchange authorization code for access token
token_url = "https://oauth2.googleapis.com/token" token_url = "https://oauth2.googleapis.com/token"