binance-connector-typescript
binance-connector-typescript copied to clipboard
π ERR_OSSL_UNSUPPORTED Error When Calling Spot.newOrder and Spot.testNewOrder Methodsπ
Problem Description:
I am encountering an ERR_OSSL_UNSUPPORTED
error when calling the Spot.newOrder
and Spot.testNewOrder
methods from the @binance/connector-typescript
library. The error occurs both when starting the application with the command NODE_OPTIONS='--openssl-legacy-provider' node --experimental-specifier-resolution=node --loader ./loader.mjs src/Api.ts
and with the command node --experimental-specifier-resolution=node --loader ./loader.mjs src/Api.ts
.
The ERR_OSSL_UNSUPPORTED
error typically indicates that OpenSSL is trying to use an algorithm or key size that is no longer allowed by default with OpenSSL 3.0. This can occur when you are using a newer version of Node.js that includes OpenSSL 3.0, but the code or modules you are using were written for an older version of OpenSSL.
Environment:
- Operating System: Ubuntu 23.04
- Node.js: v20.11.0
- OpenSSL: 3.0.8 7 Feb 2023
- pnpm: 8.15.2
List of libraries and versions used by pnpm:
{ npm: β10.2.4β, node: β20.11.0β, acorn: β8.11.2β, ada: β2.7.4β, ares: β1.20.1β, base64: β0.5.1β, brotli: β1.0.9β, cjs_module_lexer: β1.2.2β, cldr: β43.1β, icu: β73.2β, llhttp: β8.1.1β, modules: β115β, napi: β9β, nghttp2: β1.58.0β, nghttp3: β0.7.0β, ngtcp2: β0.8.1β, openssl: β3.0.12+quicβ, simdutf: β4.0.4β, tz: β2023cβ, undici: β5.27.2β, unicode: β15.0β, uv: β1.46.0β, uvwasi: β0.0.19β, v8: β11.3.244.8-node.17β, zlib: β1.2.13.1-motley-5daffc7β }
package.json
{
"name": "test",
"version": "0.1.0",
"private": true,
"type": "module",
"dependencies": {
"@binance/connector-typescript": "^0.3.6",
"@types/node": "^16.18.82",
"axios": "^1.6.5",
"bignumber.js": "^9.1.2",
"cors": "^2.8.5",
"crypto-js": "^4.2.0",
"dotenv": "^16.3.1",
"express": "^4.18.2"
},
"scripts": {
"server": "NODE_OPTIONS='--openssl-legacy-provider' node --experimental-specifier-resolution=node --loader ./loader.mjs src/Api.ts ",
"server-win": "ts-node-esm --project tsconfig.json src/Server.ts",
"server-config": "NODE_OPTIONS='--loader ts-node/esm' ts-node --showConfig"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.3.3"
}
}
tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"module": "ESNext",
"esModuleInterop": true,
"target": "ESNext",
"moduleResolution": "node",
"outDir": "dist",
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"isolatedModules": false,
"strict": true,
"noImplicitAny": true,
"useUnknownInCatchVariables": false,
"inlineSourceMap": true,
"lib": ["ESNext","ESNext.BigInt"],
"types": ["node"],
"typeRoots": ["node_modules/@types"]
},
"ts-node": {
"esm": true,
"files": true,
},
"lib": ["esnext"],
"include": ["src/*.ts", "src/*.json", ".env"],
"exclude": ["node_modules", "src/http", "src/logs"]
}
Error Details: The full error is as follows:
Error: error:1E08010C:DECODER routines::unsupported
at Object.signOneShot (node:internal/crypto/sig:163:15) at Spot.prepareSignedPath (/opt/test/node_modules/.pnpm/@[email protected]/node_modules/@binance/connector-typescript/dist/index.js:5057:27)
at Spot.newOrder (/opt/test/node_modules/.pnpm/@[email protected]/node_modules/@binance/connector-typescript/dist/index.js:3058:24)
at executeTradeTrade (file:///opt/test/src/tools/BinanceTools.ts:158:42)
at executeTradeOpportunity (file:///opt/test/src/components/Trade.ts:140:30)
at file:///opt/test/src/Api.ts:74:34 at Layer.handle [as handle_request] (/opt/test/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/test/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:144:13)
at Route.dispatch (/opt/test/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:114:3)
at Layer.handle [as handle_request] (/opt/test/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
{ library: βDECODER routinesβ, reason: βunsupportedβ, code: βERR_OSSL_UNSUPPORTEDβ }
Any help in resolving this issue would be greatly appreciated.
Additional Attempts to Start the Application:
I have also tried other ways to start the application, but they all resulted in the same ERR_OSSL_UNSUPPORTED
error.
-
Using
ts-node
directly: I tried running the application withts-node
directly using the commandts-node src/Api.ts
, but the error still occurred. -
Without the
--openssl-legacy-provider
option: I tried starting the application without the--openssl-legacy-provider
option using the commandnode --experimental-specifier-resolution=node --loader ./loader.mjs src/Api.ts
, but the error persisted. -
With different Node.js versions: I also tried using different versions of Node.js, but none of them resolved the issue.
It seems that no matter how I try to start the application, the ERR_OSSL_UNSUPPORTED
error always occurs when calling the Spot.newOrder
and Spot.testNewOrder
methods from the @binance/connector-typescript
library. Any insights or suggestions would be greatly appreciated.
+1