Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
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
14 changes: 11 additions & 3 deletions src/codegate/providers/copilot/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,20 @@ async def connect_to_target(self) -> None:
raise ValueError("Target host and port not set")

target_ssl_context = ssl.create_default_context()
target_ssl_context.check_hostname = False
target_ssl_context.verify_mode = ssl.CERT_NONE

# Ensure that the target SSL certificate is verified
target_ssl_context.check_hostname = True
target_ssl_context.verify_mode = ssl.CERT_REQUIRED

# Connect to target
logger.debug(f"Connecting to {self.target_host}:{self.target_port}")
target_protocol = CopilotProxyTargetProtocol(self)
transport, _ = await self.loop.create_connection(
lambda: target_protocol, self.target_host, self.target_port, ssl=target_ssl_context
lambda: target_protocol,
self.target_host,
self.target_port,
ssl=target_ssl_context,
server_hostname=self.target_host,
)

if self.transport and not self.transport.is_closing():
Expand Down
Loading