Open theprojectsomething opened 1 year ago
I fixed this by including all parameters in config and making a cert using mkcert.
"Host": {
"source": 8080,
"target": 8081,
"key": "localhost-key.pem",
"cert": "localhost.pem",
"hostname": "localhost"
}
For more context, the following error is caused by passing null as a first argument to fs.readFileSync here: https://github.com/cameronhunter/local-ssl-proxy/blob/main/src/main.ts#L24
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or...
Thanks @momotofu that's right. Tho I think the actual issue is that the parse
method in .lib
isn't returning sane defaults as expected.
Explicitly defining all the config params resolves the the issue. Using a locally issued cert is ideal, but if you're not worried about MITM then the cert provided with the package will also suffice (this is what the parse
method is attempting to do).
Using a
config.json
(per the instructions) fails where all details aren't provided, e.g:throws an error:
Providing an SSL cert runs the proxy, but with
undefined
for the host: