Description
OS?
Windows 10
Versions.
angular-cli: 1.0.0-beta.26
node: 7.5.0
os: win32 x64
Repro steps.
git clone https://github.com/doggy8088/angular-cli-https-proxy-error.git
cd angular-cli-https-proxy-error
npm install
npm start
- Open 'http://localhost:4200/_/help' ( this should proxy request to https://jsonbin.org/_/help )
- The page output will be
Erroroccured while trying to proxy to: localhost:4200/_/help
. - The console output will be
[HPM] Error occurred while trying to proxy request /_/help from localhost:4200 to https://jsonbin.org (EPROTO) (https://nodejs.org/api/errors.html#errors_common_system_errors)
.
The log given by the failure.
[HPM] Error occurred while trying to proxy request /_/help from localhost:4200 to https://jsonbin.org (EPROTO) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Some useful details
I tested some https webiste without any proxy request problem. Don't know why I just can't proxy my https request to https://jsonbin.org website. I need to proxy my API request to that domain.
I want to log more detail about the error. I was trying to edit the node_modules\http-proxy-middleware\lib\index.js
file for Line 145 shown as below to show the err
message.
logger.error('[HPM] Error occurred while trying to proxy request %s from %s to %s (%s) (%s)', req.url, hostname, target, err.code, err);
Here is the error output:
[HPM] Error occurred while trying to proxy request /_/help from localhost:4200 to https://jsonbin.org (EPROTO) (Error: write EPROTO 101057795:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error:openssl\ssl\s23_clnt.c:769:
)
I do can browse all these urls by browser or can send request directly from Postman. It just can't send requests to some https urls from angular-cli proxy feature.