Switch to undici Agent for HTTPS requests (#4015)

Allow the selfSignedCert: true flag in calenders array to work.
This commit is contained in:
in-voker
2026-01-17 21:34:46 +01:00
committed by GitHub
parent 37a8b11112
commit 23f0290139

View File

@@ -1,9 +1,10 @@
const https = require("node:https");
const ical = require("node-ical");
const Log = require("logger");
const { Agent } = require("undici");
const CalendarFetcherUtils = require("./calendarfetcherutils");
const { getUserAgent } = require("#server_functions");
const FIFTEEN_MINUTES = 15 * 60 * 1000;
const THIRTY_MINUTES = 30 * 60 * 1000;
const MAX_SERVER_BACKOFF = 3;
@@ -74,7 +75,11 @@ class CalendarFetcher {
const options = { headers };
if (this.selfSignedCert) {
options.agent = new https.Agent({ rejectUnauthorized: false });
options.dispatcher = new Agent({
connect: {
rejectUnauthorized: false
}
});
}
if (this.auth) {