proxy.conf option for secure = false is not working to ignore the self signed certificate
Mac OSX El Capitan
angular-cli: 1.0.0-beta.15
node: 4.4.5
os: darwin x64
api is running at https://localhost:8443/api with self signed certificate
proxy.conf.json
{ "/api": { "target": "https://localhost:8443/", "secure": "false" } }run ng serve --proxy-config proxy.conf.json
make a request to http://localhost:4200/api/_something_The log given by the failure.
[HPM] Error occurred while trying to proxy request /api/_something_ from localhost:4200 to https://localhost:8443/ (DEPTH_ZERO_SELF_SIGNED_CERT) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Same here...
when I try to use:
"secure": false
I don't get any error message but it looks like the cookie is lost somewhere on the way.
I got this same error when using the following as well.
angular-cli: 1.0.0-beta.17
node: 6.5.0
os: darwin x64
But it was pretty easy to solve. Instead of
"secure" : "false"
I used
"secure" : false
and everything worked.
Oh that seems to be the cause for the error. In https://github.com/angular/angular-cli#proxy-to-backend it's listed as a boolean as well.
This thread worked for me, I just wanted to have a definition of a good proxy conf in one place.
The correct values for proxy.conf.json are:
{
"/api": {
"target": "https://localhost:8443/",
"secure": false
}
}
I tried using ng serve --ssl but that didn't work, either. I kept seeing DEPTH_ZERO_SELF_SIGNED_CERT errors.
The api proxy backend configuration has to have secure set to false. Here's the doc on webpack's site.