Skip to content

Commit ef44f83

Browse files
committed
FIO-7661: fix self signed certificate error
1 parent 3c49a94 commit ef44f83

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/fetch.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
const fetch = require('node-fetch');
3+
const {Agent} = require('https');
34

45
module.exports = function(options = {}) {
56
const baseHeaders = {
@@ -26,6 +27,12 @@ module.exports = function(options = {}) {
2627
options.body = JSON.stringify(body);
2728
}
2829

30+
const httpsAgent = new Agent({
31+
rejectUnauthorized: false,
32+
});
33+
34+
options.agent = httpsAgent;
35+
2936
return fetch(url, options).then(response => {
3037
const res = {
3138
status: response.status,

0 commit comments

Comments
 (0)