I get the error
RequestError: self signed certificate in certificate chain
when running this command for example:
yarn set version latest
I'm using the proxy and httpsProxy config options.
Earlier using Yarn V1 it was possible to specify a cafile. But I can't find any configuration like this for berry.
It isn't implemented at the moment. PR welcome 馃憪
Hey @arcanis, can I implement a PR for this?
Here is what I've found.
berry uses a tunnel for proxy, the proxy object in httpUtils.ts#L22 uses only host and port (and empty headers object).
The tunnel package accepts following options to construct a proxy,
{
host: proxyHost, // Defaults to 'localhost'
port: proxyPort, // Defaults to 443
localAddress: localAddress, // Local interface if necessary
// Basic authorization for proxy server if necessary
proxyAuth: 'user:password',
// Header fields for proxy server if necessary
headers: {
'User-Agent': 'Node'
},
// CA for proxy server if necessary
ca: [ fs.readFileSync('origin-server-ca.pem')],
// Server name for verification if necessary
servername: 'example.com',
// Client certification for proxy server if necessary
key: fs.readFileSync('origin-server-key.pem'),
cert: fs.readFileSync('origin-server-cert.pem'),
}
What should be implemented for this (ca, key, cert as well as proxyAuth, servername, and localAddress) and what should be the options names,
proxyCA for caproxyClientKey for keyproxyClientCert for certproxyHeaders for headers maybe?And what about other options such as proxyAuth, localAddress, and servername?
Support for caFilePath was added in https://github.com/yarnpkg/berry/pull/1934
Most helpful comment
Hey @arcanis, can I implement a PR for this?
Here is what I've found.
berryuses a tunnel for proxy, the proxy object in httpUtils.ts#L22 uses onlyhostandport(and emptyheadersobject).The tunnel package accepts following options to construct a proxy,
What should be implemented for this (
ca,key,certas well asproxyAuth,servername, andlocalAddress) and what should be the options names,proxyCAforcaproxyClientKeyforkeyproxyClientCertforcertproxyHeadersforheadersmaybe?And what about other options such as
proxyAuth,localAddress, andservername?