1

Using Aurelia, backed is using self signed certificate and NodeJS refuses to forward requests over HTTPS if the certificate is not trusted.

[HPM] Error occurred while trying to proxy request /rest/open/test/test-por
tal-url=abcdsdf/ui-settings from localhost:9000 to https://localhost:9443 
(DEPTH_ZERO_SELF_SIGNED_CERT) 
(https://nodejs.org/api/errors.html#errors_common_system_errors)

Tried process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; but I'm getting "process is not defined". Also, tried to set environmental variable but no go.

Vijay Nandwana
  • 2,476
  • 4
  • 25
  • 42

1 Answers1

1

While configuring middleware, browserSync>server>middleware, used secure: false property to fix this issue.

middleware.push(proxy('/test-portal/rest', {
        target: environmentConfig.testApi,
        secure: false,
        logLevel: 'debug',
        changeOrigin: true
    }));
Vijay Nandwana
  • 2,476
  • 4
  • 25
  • 42