Skip to content

Commit 5e788fc

Browse files
author
aheizi
committed
remove rejectUnauthorized
1 parent f534e80 commit 5e788fc

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/services/mcp/McpHub.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,6 @@ export class McpHub {
167167
}
168168
}
169169

170-
private isLocalhost(hostname: string): boolean {
171-
return (
172-
hostname === "localhost" ||
173-
hostname === "127.0.0.1" ||
174-
hostname === "::1" ||
175-
hostname.endsWith(".localhost") ||
176-
hostname.endsWith(".local")
177-
)
178-
}
179-
180170
private async connectToServer(name: string, config: z.infer<typeof ServerConfigSchema>): Promise<void> {
181171
// Remove existing connection if it exists
182172
await this.deleteConnection(name)
@@ -251,15 +241,8 @@ export class McpHub {
251241
const sseOptions = {
252242
requestInit: {
253243
headers: config.headers,
254-
// Only disable certificate validation for local development connections
255-
...(this.isLocalhost(new URL(config.url).hostname) && {
256-
agent: new (require("https").Agent)({
257-
rejectUnauthorized: false,
258-
}),
259-
}),
260244
},
261245
}
262-
// @ts-ignore - EventSource types are not fully compatible
263246
global.EventSource = EventSource
264247
transport = new SSEClientTransport(new URL(config.url), sseOptions)
265248

0 commit comments

Comments
 (0)