mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
Merge pull request #2458 from codac/patch-2
This is supposed to make self signed certs work with the calendar module
This commit is contained in:
@@ -25,9 +25,10 @@ const moment = require("moment");
|
||||
* @param {number} maximumNumberOfDays The maximum number of days an event should be in the future.
|
||||
* @param {object} auth The object containing options for authentication against the calendar.
|
||||
* @param {boolean} includePastEvents If true events from the past maximumNumberOfDays will be fetched too
|
||||
* @param {boolean} selfSignedCert If true, the server certificate is not verified against the list of supplied CAs.
|
||||
* @class
|
||||
*/
|
||||
const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) {
|
||||
const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents, selfSignedCert) {
|
||||
const self = this;
|
||||
|
||||
let reloadTimer = null;
|
||||
@@ -51,6 +52,13 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
|
||||
gzip: true
|
||||
};
|
||||
|
||||
if (selfSignedCert) {
|
||||
var agentOptions = {
|
||||
rejectUnauthorized: false
|
||||
};
|
||||
opts.agentOptions = agentOptions;
|
||||
}
|
||||
|
||||
if (auth) {
|
||||
if (auth.method === "bearer") {
|
||||
opts.auth = {
|
||||
|
Reference in New Issue
Block a user