Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions devchat/openai/http_openai.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import http.client
import json
import os
import ssl
import sys
from urllib.parse import urlparse

Expand Down Expand Up @@ -71,10 +72,12 @@ def stream_request(api_key, api_base, data):

if api_base.startswith("https://"):
if proxy_setting["host"]:
connection = http.client.HTTPSConnection(**proxy_setting)
connection = http.client.HTTPSConnection(
**proxy_setting, context=ssl._create_unverified_context()
)
connection.set_tunnel(url)
else:
connection = http.client.HTTPSConnection(url)
connection = http.client.HTTPSConnection(url, context=ssl._create_unverified_context())
else:
if proxy_setting["host"]:
connection = http.client.HTTPConnection(**proxy_setting)
Expand Down