4

I want to know

  1. Why this happens
  2. How to solve it gracefully

Here's my situation.

  • My local non-custom nextjs needs to serve over https in domain my.company.com. (cookies are concerned)
  • This script solves incoming https request (from this solution): local-ssl-proxy --key ./certs/key.pem --cert ./certs/cert.pem --source 3000 --target 3001) & next dev -p 3001 (the key and the cert are for *.company.com from public CA)
  • But server to server outgoing https requests through an axios instance still meets UNABLE_TO_VERIFY_LEAF_SIGNATURE, why?
  • Adding node option NODE_TLS_REJECT_UNAUTHORIZED=0 to the above script (or this solution) solves local dev environment, but this doesn't really look safe. Would there be an actual solution while not using a web server and not using custom nextjs server? I don't want neither my local dev environment to be heavy or to break nextjs routing feature.
Changdae Park
  • 911
  • 1
  • 9
  • 22

0 Answers0