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

NodeJS 报错 UnsupportedCertVersion #127

Closed
feix760 opened this issue Jan 14, 2025 · 7 comments
Closed

NodeJS 报错 UnsupportedCertVersion #127

feix760 opened this issue Jan 14, 2025 · 7 comments

Comments

@feix760
Copy link

feix760 commented Jan 14, 2025

问题描述

交易接口(TradeContext)报错,行情接口(QuoteContext)正常

代码例子

import { Config, TradeContext, QuoteContext } from 'longport';

let config = Config.fromEnv()

TradeContext.new(config)
  .then((ctx) => ctx.accountBalance())
  .then((resp) => {
    for (let obj of resp) {
      console.log(obj.toString());
    }
  });

错误信息或结果截图

截屏2025-01-14 下午5 06 25

你的环境信息

  • 操作系统: macOS 15.1.1
  • 开发语言: Node.js (20.11.1)
  • SDK 版本号:2.1.5
@sunli829
Copy link
Collaborator

试试设置 LONGPORT_REGION=cn 环境变量强制切换到大陆线路能不能解决

@feix760
Copy link
Author

feix760 commented Jan 14, 2025

试试设置 LONGPORT_REGION=cn 环境变量强制切换到大陆线路能不能解决

同样的报错
截屏2025-01-14 下午5 31 29

@feix760
Copy link
Author

feix760 commented Jan 14, 2025

rust 动态库里有证书吗? 版本是 3 吗? 我看说可能加载了非版本 3 的证书,还是说我机器里有非版本3的根证书被 rust 加载报错了?

@sunli829
Copy link
Collaborator

浏览器能正常访问这个地址吗?

https://openapi.longportapp.cn/_ping

正常会显示一个 pong

@sunli829
Copy link
Collaborator

根证书没有使用系统的,编译在二进制里了

@feix760
Copy link
Author

feix760 commented Jan 14, 2025

浏览器能正常访问这个地址吗?

https://openapi.longportapp.cn/_ping

正常会显示一个 pong

可以正常访问

@feix760
Copy link
Author

feix760 commented Jan 14, 2025

浏览器能正常访问这个地址吗?

https://openapi.longportapp.cn/_ping

正常会显示一个 pong

问题解决了,是公司网络拦截了 https://openapi-trade.longportapp.cn/ ,感谢老板~~~

@feix760 feix760 closed this as completed Jan 14, 2025
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