diff --git a/nodes/config/ui_base.js b/nodes/config/ui_base.js index 3b5dde3d..09e19474 100644 --- a/nodes/config/ui_base.js +++ b/nodes/config/ui_base.js @@ -1130,7 +1130,17 @@ module.exports = function (RED) { const host = RED.settings.uiHost const port = RED.settings.uiPort const httpAdminRoot = RED.settings.httpAdminRoot - const url = 'http://' + (`${host}:${port}/${httpAdminRoot}flows`).replace('//', '/') + let scheme = 'http://' + let httpsAgent + if (RED.settings.requireHttps) { + if (RED.settings.https) { + httpsAgent = new Agent({ + rejectUnauthorized: false + }) + } + scheme = 'https://' + } + const url = scheme + (`${host}:${port}/${httpAdminRoot}flows`).replace('//', '/') console.log('url', url) // get request body const dashboardId = req.params.dashboardId