safe-global / safe-core-sdk

The Safe{Core} SDK allows builders to add account abstraction functionality into their apps.

Home Page:https://docs.safe.global/sdk/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

write EPROTO 4078382E9E7F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354

carlomigueldy opened this issue · comments

Description

image

Called proposeTransaction on Base Sepolia Testnet to my Safe and it throws an exception about wrong version number on SSL related.

See gist here.

Environment

  • Safe Core SDK version:
    • @safe-global/api-kit = ^2.4.0
    • @safe-global/protocol-kit = ^4.0.0
    • @safe-global/safe-core-sdk-types = ^5.0.0
  • Safe contract version: 1.3.0+L2
  • Environment:
    • browser
    • non-browser

Steps to reproduce

Based on instructions given from Protocol Kit docs, given all valid parameters then just executing it on Safe that is on Base Sepolia Testnet. It will throw the exception.

See gist here.

Expected result

Throws this exception.

[App] - 5/27/2024, 11:16:32 PM   ERROR  [SafeAppService.proposeTransaction]: Error while proposing transaction request to https://safe-transaction-base-sepolia.safe.global/api/v1/safes/0x3DbE5B38d41394A756246997407408b421937c7B/multisig-transactions/ failed, reason: write EPROTO 4078382E9E7F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:
 - {
  type: 'system',
  errno: 'EPROTO',
  code: 'EPROTO',
  stack: 'FetchError: request to https://safe-transaction-base-sepolia.safe.global/api/v1/safes/0x3DbE5B38d41394A756246997407408b421937c7B/multisig-transactions/ failed, reason: write EPROTO 4078382E9E7F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:\n' +
    '\n' +
    '    at ClientRequest.<anonymous> (/home/carlomigueldy/dev/limitless-labs-group/limitless-exchange-api/node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1501:11)\n' +
    '    at ClientRequest.emit (node:events:519:28)\n' +
    '    at TLSSocket.socketErrorListener (node:_http_client:500:9)\n' +
    '    at TLSSocket.emit (node:events:519:28)\n' +
    '    at emitErrorNT (node:internal/streams/destroy:169:8)\n' +
    '    at emitErrorCloseNT (node:internal/streams/destroy:128:3)\n' +
    '    at processTicksAndRejections (node:internal/process/task_queues:82:21)'
} +497ms

Additional context

#823 is a related ticket.

I was testing locally but I'm not getting this error. The gist code looks good, and for the kind of error seems some configuration issues with node-fetch. Usually you get those when for example targeting a wrong port.

Are you using node-fetch for your project directly? Are you setting up some configuration that may interfere with the one in the api-kit?

@dasanra I didn't explicitly setup anything related to node-fetch. But one thing I did for Nest.js is using FastifyAdapter, could it be the the reason?

image

Yes, it could be related. It seems an issue because FastifyAdapter is not configured to use HTTPS so tries to send the request via HTTP.

https://docs.nestjs.com/faq/multiple-servers