disable unauthorization rejection when making https requests limited to lokiRpc

pull/759/head
Ryan Tharp 5 years ago
parent 04e1d58a50
commit 646c3b2f26

@ -2,8 +2,13 @@
libsignal, window, TextDecoder, TextEncoder, dcodeIO */
const nodeFetch = require('node-fetch');
const https = require('https');
const { parse } = require('url');
const snodeHttpsAgent = new https.Agent({
rejectUnauthorized: false
});
const LOKI_EPHEMKEY_HEADER = 'X-Loki-EphemKey';
const endpointBase = '/storage_rpc/v1';
@ -115,6 +120,9 @@ const lokiFetch = async (url, options = {}, targetNode = null) => {
timeout,
method,
};
if (url.match(/https:\/\//)) {
fetchOptions.agent = snodeHttpsAgent;
}
try {
if (window.lokiFeatureFlags.useSnodeProxy && targetNode) {

Loading…
Cancel
Save