簡體   English   中英

在Github Api中關閉證書驗證

[英]Turn off cerficate validation in Github Api

我正在使用這個github api

var github = new GitHubApi({
    // optional
    debug: true,
    protocol: "http",
    host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub
    pathPrefix: "/api/v3", // for some GHEs; none for GitHub
    headers: {
        "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent
    },
    Promise: require('bluebird'),
    followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects
    timeout: 5000
});

想為從Node js中此對象進行的所有HTTP請求關閉證書驗證

如何發送,是否需要發送任何特定的標頭值以將其關閉?

你可以試試 :

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

但這會使所有請求都不安全

所以...我認為rejectUnauthorized:true是您要尋找的代理選項。

由於node-github使用https-proxy-agent,所以我認為您必須在666行的構造函數使用proxyUrl.rejectUnauthorized = true之前

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM