Node.js HTTP开发遇到的若干问题

来源:互联网 发布:打印证件的软件 编辑:程序博客网 时间:2024/05/29 19:55

1 Error: getaddrinfo ENOTFOUND http://xx.dd.com

   解决方法:在node.js中使用http或者https发送请求的时候host不要带http://或者https://,直接写xx.yy.com即可。

2 Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:782

   解决方法:使用https的时候的默认端口是443,如果在设置端口的时候设置成了80会报此错误。改成443或者server定义的https的端口即可。

3 error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message:s23_clnt.c:658:*

   解决方法: https client使用的ssl version和server端不能匹配,在options里添加options = { secureProtocol: 'SSLv3_method' }即可。

0 0
原创粉丝点击