Node尝试用axios请求一个网站的时候无法爬取,报ecx_key_op:invalid encoding是什么原因?

尝试用node的request以及axios爬取网站都发送这个错误是什么原因??

Error: write EPROTO 3168:error:1010A066:elliptic curve routines:ecx_key_op:invalid encoding:c:\ws\deps\openssl\openssl\crypto\ec\ecx_meth.c:65:
3168:error:141A4132:SSL routines:tls_process_ske_ecdhe:bad ecpoint:c:\ws\deps\openssl\openssl\ssl\statem\statem_clnt.c:2231:
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
  errno: -4046,
  code: 'EPROTO',
  syscall: 'write'
}

image.png

阅读 6k
1 个回答

你是不是使用了代理,然后代理没配正确?或者是对方是https,然后你的访问的是http的?可以看下这几个链接:
1:https://www.nuomiphp.com/eplan/112325.html
2:https://www.it1352.com/1957734.html
3:https://stackoverflow.com/questions/46828047/getting-error-while-npm-install-request-to-https-registry-npmjs-org-axios-fa

第3个链接,别人报的错如下,和你的很像,答案是说关闭代理后就行了。

npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/axios failed, reason: write EPROTO 139829807306560:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abhi/.npm/_logs/2017-10-19T10_20_30_486Z-debug.log
abhi@abhi-HP-Pavilion-15-Notebook-PC:~/Desktop/react-chat$ npm config set strict-ssl falseabhi@abhi-HP-Pavilion-15-Notebook-PC:~/Desktop/react-chat$ npm install
npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/axios failed, reason: write EPROTO 140309084555072:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abhi/.npm/_logs/2017-10-19T10_22_15_980Z-debug.log
abhi@abhi-HP-Pavilion-15-Notebook-PC:~/Desktop/react-chat$ npm install
npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/axios failed, reason: write EPROTO 139873739618112:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abhi/.npm/_logs/2017-10-19T10_24_36_169Z-debug.log
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题