Node.js HTTPS server ERR_EMPTY_RESPONSE

前端 未结 2 530
面向向阳花
面向向阳花 2020-12-19 05:29

I created the server.key and server.csr files using openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr. I created a SSL certificate with sta

2条回答
  •  一个人的身影
    2020-12-19 05:53

    I know this is an old question, but I encountered the same thing today. I would get the same result back from express (ERR_EMPTY_RESPONSE).

    The fix? Be sure to specify https, and not http, in your test browser (e.g., https://localhost:8443).

    If you previously used middleware to forward all http requests to https you wouldn't have seen this problem before. Also, expect your browser to complain about the certificate, but proceed through anyway (in chrome this takes several clicks).

提交回复
热议问题