Просмотр исходного кода

remove rejectUnauthorized

(cherry picked from commit 5e788fc5f1de49ea7972f4d803d24c0c6544ed79)
aheizi 9 месяцев назад
Родитель
Сommit
78b3130c93
1 измененных файлов с 0 добавлено и 17 удалено
  1. 0 17
      src/services/mcp/McpHub.ts

+ 0 - 17
src/services/mcp/McpHub.ts

@@ -167,16 +167,6 @@ export class McpHub {
 		}
 	}
 
-	private isLocalhost(hostname: string): boolean {
-		return (
-			hostname === "localhost" ||
-			hostname === "127.0.0.1" ||
-			hostname === "::1" ||
-			hostname.endsWith(".localhost") ||
-			hostname.endsWith(".local")
-		)
-	}
-
 	private async connectToServer(name: string, config: z.infer<typeof ServerConfigSchema>): Promise<void> {
 		// Remove existing connection if it exists
 		await this.deleteConnection(name)
@@ -251,15 +241,8 @@ export class McpHub {
 				const sseOptions = {
 					requestInit: {
 						headers: config.headers,
-						// Only disable certificate validation for local development connections
-						...(this.isLocalhost(new URL(config.url).hostname) && {
-							agent: new (require("https").Agent)({
-								rejectUnauthorized: false,
-							}),
-						}),
 					},
 				}
-				// @ts-ignore - EventSource types are not fully compatible
 				global.EventSource = EventSource
 				transport = new SSEClientTransport(new URL(config.url), sseOptions)