Fix SSL
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
dvirlabs 2026-05-13 10:52:30 +03:00
parent e4fb9cf62f
commit d9cdddb8c8

View File

@ -3,7 +3,6 @@ WhatsApp Cloud API Service
Handles sending WhatsApp messages via Meta's API Handles sending WhatsApp messages via Meta's API
""" """
import os import os
import ssl
import httpx import httpx
import certifi import certifi
import re import re
@ -167,8 +166,7 @@ class WhatsAppService:
url = f"{self.base_url}/{self.phone_number_id}/messages" url = f"{self.base_url}/{self.phone_number_id}/messages"
try: try:
ssl_ctx = ssl.create_default_context(cafile=certifi.where()) async with httpx.AsyncClient(verify=certifi.where()) as client:
async with httpx.AsyncClient(verify=ssl_ctx) as client:
response = await client.post( response = await client.post(
url, url,
json=payload, json=payload,
@ -298,8 +296,7 @@ class WhatsAppService:
print("=" * 80 + "\n") print("=" * 80 + "\n")
try: try:
ssl_ctx = ssl.create_default_context(cafile=certifi.where()) async with httpx.AsyncClient(verify=certifi.where()) as client:
async with httpx.AsyncClient(verify=ssl_ctx) as client:
response = await client.post( response = await client.post(
url, url,
json=payload, json=payload,
@ -548,8 +545,7 @@ class WhatsAppService:
url = f"{self.base_url}/{self.phone_number_id}/messages" url = f"{self.base_url}/{self.phone_number_id}/messages"
try: try:
ssl_ctx = ssl.create_default_context(cafile=certifi.where()) async with httpx.AsyncClient(verify=certifi.where()) as client:
async with httpx.AsyncClient(verify=ssl_ctx) as client:
response = await client.post( response = await client.post(
url, url,
json=payload, json=payload,