Some tweaks

This commit is contained in:
Reinier Criel 2025-11-12 13:11:02 -08:00
parent f2bf5869ba
commit fdef9e0766
2 changed files with 7 additions and 6 deletions

View file

@ -30,7 +30,6 @@ export async function runPip(command, args) {
// To counter behavior that is sometimes seen where pip ignores REQUESTS_CA_BUNDLE/SSL_CERT_FILE, // To counter behavior that is sometimes seen where pip ignores REQUESTS_CA_BUNDLE/SSL_CERT_FILE,
// We will set additional env vars for pip // We will set additional env vars for pip
if (!env.PIP_CERT) { if (!env.PIP_CERT) {
env.PIP_CERT = combinedCaPath; env.PIP_CERT = combinedCaPath;
} }
@ -38,15 +37,13 @@ export async function runPip(command, args) {
const tmpDir = os.tmpdir(); const tmpDir = os.tmpdir();
const pipConfigPath = path.join(tmpDir, `safe-chain-pip-${Date.now()}.ini`); const pipConfigPath = path.join(tmpDir, `safe-chain-pip-${Date.now()}.ini`);
// Proxy settings // Proxy settings: prefer GLOBAL_AGENT_HTTP_PROXY, then HTTPS_PROXY, then HTTP_PROXY
const httpProxy = env.HTTP_PROXY || ''; const proxy = env.GLOBAL_AGENT_HTTP_PROXY || env.HTTPS_PROXY || env.HTTP_PROXY || '';
const httpsProxy = env.HTTPS_PROXY || '';
// Build pip config INI // Build pip config INI
let pipConfig = '[global]\n'; let pipConfig = '[global]\n';
pipConfig += `cert = ${combinedCaPath}\n`; pipConfig += `cert = ${combinedCaPath}\n`;
if (httpProxy) pipConfig += `proxy = ${httpProxy}\n`; if (proxy) pipConfig += `proxy = ${proxy}\n`;
if (httpsProxy) pipConfig += `proxy = ${httpsProxy}\n`;
await fs.writeFile(pipConfigPath, pipConfig); await fs.writeFile(pipConfigPath, pipConfig);
env.PIP_CONFIG_FILE = pipConfigPath; env.PIP_CONFIG_FILE = pipConfigPath;

View file

@ -48,6 +48,10 @@ export function generateCertForHost(hostname) {
digitalSignature: true, digitalSignature: true,
keyEncipherment: true, keyEncipherment: true,
}, },
{
name: "extKeyUsage",
serverAuth: true,
},
]); ]);
cert.sign(ca.privateKey, forge.md.sha256.create()); cert.sign(ca.privateKey, forge.md.sha256.create());