Yes
Yes
SSL, Proxy
node -v: 8.4.0npm -v: 5.3.0yarn --version (if you use Yarn): 1.3.2npm ls react-scripts (if you haven鈥檛 ejected): [email protected]Then, specify:
(Write your steps here:)
"proxy": {
"/api": {
"target": "https://metachurch.dev"
}
}
Above is a local site using laravel valet, and secured using a self signed certificate
ENVIRONMENT="dev"
REACT_APP_GRAPHQL_URI="/api"
NODE_TLS_REJECT_UNAUTHORIZED=0
HTTPS=true
Proxy error: Could not proxy request /api from localhost:3000 to https://metachurch.dev.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (UNABLE_TO_VERIFY_LEAF_SIGNATURE).
React app is starts and traffic sent to /api is routed through to https://mydomain.dev/api rather than https://localhost:3000/api
React app starts, but traffic is being routed to https://localhost:3000/api, and a proxy error message is displayed in terminal


Have you tried everything in this SO answer?
@heyimalex I went through and tried some of the potential fixes that I hadn't previously tried, but still ended up with the same error.
@edolyne I'm running into the same problem. The frustrating part is if I visit localhost:3000 (create react server) and localhost:5000 (API server) they are both HTTPS verified. But for some reason, the proxy breaks down.
+1 on this problem
I had the same problem and looked into react-scripts whats actually happening with the proxy config from package.json. The config is just passed to webpack devserver which supports a secure: false option that disables certificate check.
I adjusted my config like this:
"proxy": {
"/api": {
"target": "https://localhost:8443",
"pathRewrite": {
"^/api": ""
},
"secure": false
}
},
and now it works 馃檪
Most helpful comment
I had the same problem and looked into react-scripts whats actually happening with the proxy config from package.json. The config is just passed to webpack devserver which supports a
secure: falseoption that disables certificate check.I adjusted my config like this:
and now it works 馃檪