add some API-nodes to js/disabling-certificate-validation

This commit is contained in:
Erik Krogh Kristensen
2022-03-14 21:33:13 +01:00
parent 6a74e761c8
commit 195ce9c58a
3 changed files with 32 additions and 18 deletions

View File

@@ -8,3 +8,4 @@
| tst.js:39:2:39:29 | rejectU ... ndirect | Disabling certificate validation is strongly discouraged. |
| tst.js:45:2:45:28 | rejectU ... !!false | Disabling certificate validation is strongly discouraged. |
| tst.js:48:2:48:26 | rejectU ... : !true | Disabling certificate validation is strongly discouraged. |
| tst.js:74:9:74:33 | rejectU ... : false | Disabling certificate validation is strongly discouraged. |

View File

@@ -68,3 +68,10 @@ new https.Agent({
new https.Agent({
rejectUnauthorized: typeof getOptions().rejectUnauthorized === 'boolean' ? getOptions().rejectUnauthorized : undefined // OK
});
function getSomeunsafeOptions() {
return {
rejectUnauthorized: false // NOT OK
}
}
new https.Agent(getSomeunsafeOptions());