mgcrea / mgcrea/node-tydom-client

SSL routines:final_renegotiate:unsafe legacy renegotiation disabled

Open
#18 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
29
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hi!

When using the Tydom's local IP instead of the default mediation.tydom.com, the program fails with an SSL error, even with NODE_TLS_REJECT_UNAUTHORIZED=0:

$ export NODE_TLS_REJECT_UNAUTHORIZED=0
$ npx tydom-client request /ping --username 00XXXXXXXXXX --password XXXXXXXX --hostname 192.168.0.XXX
Creating tydom client ...
Connecting to hostname='192.168.0.XXX' with username='00XXXXXXXXXX' ...
  tydom-client About to GET request with url='https://192.168.0.XXX/mediation/client?mac=00XXXXXXXXXX&appli=1' +0ms
(node:109230) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
tydom request [uri]

request tydom

Positionals:
  uri  request uri                                           [string] [required]

Options:
      --version   Show version number                                  [boolean]
      --username  tydom username                             [string] [required]
      --password  tydom password                             [string] [required]
      --hostname  request hostname
                            [string] [required] [default: "mediation.tydom.com"]
      --method    request method                       [string] [default: "GET"]
      --command   request command                     [boolean] [default: false]
  -v, --verbose   Run with verbose logging                             [boolean]
      --help      Show help                                            [boolean]
      --file      save to file                                          [string]

Examples:
  tydom request /info --file info.json

RequestError: write EPROTO C087DDC9357F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../ssl/statem/extensions.c:893:

    at ClientRequest.<anonymous> (/tmp/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at origin.emit (/tmp/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at TLSSocket.socketErrorListener (node:_http_client:494: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)
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
  code: 'EPROTO',
  timings: {
    start: 1672346359527,
    socket: 1672346359532,
    lookup: 1672346359539,
    connect: 1672346359539,
    secureConnect: undefined,
    upload: 1672346359545,
    response: undefined,
    end: undefined,
    error: 1672346359547,
    abort: undefined,
    phases: {
      wait: 5,
      dns: 7,
      tcp: 0,
      tls: undefined,
      request: 6,
      firstByte: undefined,
      download: undefined,
      total: 20
    }
  }
}

The same command works when removing the --hostname option.

Is this a known issue?

Versions:
"mainVersionSW": "03.04.15",
"mainVersionHW": "00.00.01"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the documented tydom-client request command and a local --hostname, then trace hostname handling into the HTTPS request that fails in got. Compare it with the default mediation.tydom.com request and determine what change is needed for local Tydom devices. Done means the local-IP request completes without the reported EPROTO renegotiation error while preserving the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.