Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL error using node 17+ #34

Closed
vincentsels opened this issue Aug 7, 2023 · 4 comments
Closed

SSL error using node 17+ #34

vincentsels opened this issue Aug 7, 2023 · 4 comments

Comments

@vincentsels
Copy link

vincentsels commented Aug 7, 2023

Describe the bug
All requests result in the following error:

C:\Projects\ext\translate-doc\node_modules\deepl-node\dist\client.js:163
            const error = new errors_1.ConnectionError(`Connection failure: ${message}`);
                          ^

ConnectionError: Connection failure: write EPROTO 98720000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\ws\de
ps\openssl\openssl\ssl\statem\extensions.c:922:

    at HttpClient.sendAxiosRequest (C:\Projects\ext\translate-doc\node_modules\deepl-node\dist\client.js:163:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HttpClient.sendRequestWithBackoff (C:\Projects\ext\translate-doc\node_modules\deepl-node\dist\client.js:114:28)
    at async Translator.translateText (C:\Projects\ext\translate-doc\node_modules\deepl-node\dist\index.js:355:41)
    at async file:///C:/Projects/ext/translate-doc/index.js:7:20 {
  error: AxiosError: write EPROTO 98720000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\ws\deps\openssl\opens
sl\ssl\statem\extensions.c:922:

      at AxiosError.from (C:\Projects\ext\translate-doc\node_modules\axios\dist\node\axios.cjs:836:14)
      at RedirectableRequest.handleRequestError (C:\Projects\ext\translate-doc\node_modules\axios\dist\node\axios.cjs:3010:25)
      at RedirectableRequest.emit (node:events:525:35)
      at eventHandlers.<computed> (C:\Projects\ext\translate-doc\node_modules\follow-redirects\index.js:14:24)
      at ClientRequest.emit (node:events:513:28)
      at TLSSocket.socketErrorListener (node:_http_client:502:9)
      at TLSSocket.emit (node:events:513:28)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

The underlying issue is probably the following: https://stackoverflow.com/questions/74324019/allow-legacy-renegotiation-for-nodejs

This only occurs on Node 17+.

To Reproduce

  1. Install node 18 (possibly using nvm)
  2. Create a new basic npm project npm init with index.js
  3. npm install deepl-node
  4. Copy/paste the contents of the 'hello world' example
  5. Enter authKey
  6. node index.js
  7. Generates the above error.

Expected behavior
The translation is logged to the console

Desktop

  • OS: Windows
  • Node 18.16.1
@JanEbbing
Copy link
Member

Hi @vincentsels , thanks for your detailed report.
What is the version of OpenSSL you are using? Is it possible to update it? Are you behind a proxy/in a VPN or something similar?

@vincentsels
Copy link
Author

vincentsels commented Aug 7, 2023

Indeed, it was the company's AnyConnect VPN (or firewall)...

@JanEbbing
Copy link
Member

Is the issue resolved then, or do you need to get it to work within the VPN?

@vincentsels
Copy link
Author

vincentsels commented Aug 7, 2023

In my case I can just switch off the VPN while working on this project, so I'll close! I don't suppose there's an easy way to solve it generically for all VPN types / firewalls / ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants