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

🐞 ERR_OSSL_UNSUPPORTED Error When Calling Spot.newOrder and Spot.testNewOrder Methods🐞 #15

Open
oviniciusfeitosa opened this issue Feb 22, 2024 · 3 comments

Comments

@oviniciusfeitosa
Copy link

oviniciusfeitosa commented Feb 22, 2024

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.

@oviniciusfeitosa
Copy link
Author

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.

  1. Using ts-node directly:
    I tried running the application with ts-node directly using the command ts-node src/Api.ts, but the error still occurred.

  2. Without the --openssl-legacy-provider option:
    I tried starting the application without the --openssl-legacy-provider option using the command node --experimental-specifier-resolution=node --loader ./loader.mjs src/Api.ts, but the error persisted.

  3. 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.

@zhaoyangnk
Copy link

+1

@alplabin
Copy link
Contributor

@oviniciusfeitosa Do you still get the error with the latest version?

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

3 participants