webpack-dev-server 1.15.1 proxy error: depth_zero_self_signed_cert

Created on 2 Sep 2016  路  3Comments  路  Source: webpack/webpack-dev-server

Because I configure dev server to proxy to a back-end API which uses a self-signed certification.

I tried to set:

NODE_TLS_REJECT_UNAUTHORIZED = 0

but with no luck to avoid such error. I know it's unsafe, but I only want to allow it in my develop environment

Most helpful comment

Have you tried adding secure: false in the proxy config? E.g. proxy:{ '/api/**': { target: 'https://localhost:4001', secure: false } }

All 3 comments

Have you tried adding secure: false in the proxy config? E.g. proxy:{ '/api/**': { target: 'https://localhost:4001', secure: false } }

Also see config options for proxy: https://github.com/chimurai/http-proxy-middleware

Oh, yes, it works. Thank you for your help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uMaxmaxmaximus picture uMaxmaxmaximus  路  3Comments

Ky6uk picture Ky6uk  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

subblue picture subblue  路  3Comments