refactor(OpenCode TLS): 共用 httpsAgent 建立邏輯

This commit is contained in:
2026-06-20 13:42:25 +00:00
parent c662a2e362
commit babe599977
3 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ import {
GITEA_REPOSITORY,
GITEA_SKIP_TLS_VERIFY,
PR_NUMBER,
getOpenCodeHttpsAgent,
getLLMConfig,
shouldSkipOpenCodeTLSVerify,
} from './config.js';
import { verifyRemoteAccess } from './git.js';
import { step, line, ok, error } from './log.js';
@@ -30,7 +30,7 @@ const applyOpenCodeAuth = (headers) => {
const opencodeAxiosOptions = (headers) => ({
headers,
timeout: 30000,
httpsAgent: shouldSkipOpenCodeTLSVerify() ? new https.Agent({ rejectUnauthorized: false }) : undefined,
httpsAgent: getOpenCodeHttpsAgent(),
});
function giteaErr(e) {