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
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
Most helpful comment
Have you tried adding
secure: falsein the proxy config? E.g.proxy:{ '/api/**': { target: 'https://localhost:4001', secure: false } }