-
-
Notifications
You must be signed in to change notification settings - Fork 545
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
部署到白山云时继续返回 400209 错误 #544
Comments
config 传多个值的时候 URL 是啥样的? |
@Anbool 看起来白山云用了某种非标的 URL 传参方式,试着改了改。但我没有白山云账号,你可以帮我拉一下 commit 代码后用你的 Token 跑一下单测用例吗? commit: 516a958 终端进入到项目的 # 请将参数替换为实际值
go test -v ./baishan_cdn_test.go -args --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTCERTPATH="/path/to/your-input-cert.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTKEYPATH="/path/to/your-input-key.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_APITOKEN="your-api-token" --CERTIMATE_DEPLOYER_BAISHANCDN_DOMAIN="example.com" |
可以的,这两天测试后给你反馈 |
我已经进行了测试并失败,以下是测试日志。不过值得一提的是,白山云 API 的接口传递数组参数确实是非标的:https://cdn.api.baishan.com/v2/domain/config?token=token&domains=www.test.com&config[]=referer&config[]=origin root@Small-Build:/data/certimate# git status root@Small-Build:/data/certimate# cd internal/pkg/core/deployer/providers/baishan-cdn/ root@Small-Build:/data/certimate/internal/pkg/core/deployer/providers/baishan-cdn# ls root@Small-Build:/data/certimate/internal/pkg/core/deployer/providers/baishan-cdn# go test -v ./baishan_cdn_test.go -args --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTCERTPATH="/root/cert.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTKEYPATH="/root/key.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_APITOKEN="这是一个Token" --CERTIMATE_DEPLOYER_BAISHANCDN_DOMAIN="这是一个域名" go: downloading github.com/pkg/errors v0.9.1
|
root@Small-Build:/data/certimate/internal/pkg/core/deployer/providers/baishan-cdn# go test -v ./baishan_cdn_test.go -args --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTCERTPATH="/root/cert.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_INPUTKEYPATH="/root/key.pem" --CERTIMATE_DEPLOYER_BAISHANCDN_APITOKEN="这是一个Token" --CERTIMATE_DEPLOYER_BAISHANCDN_DOMAIN="这是一个域名" |
版本号:0.3.5
问题:我注意到似乎已经是数组了,但不知道为什么仍然返回了错误。
日志:
[2025-03-22 14:07:20] ready to deploy ...
[2025-03-22 14:07:21] sdk request 'baishan.GetDomainConfig'
request:
{"domains":"google.com","config":["https"]}
response:
null
[2025-03-22 14:07:21] failed to deploy
[2025-03-22 14:07:21] failed to execute sdk request 'baishan.GetDomainConfig': baishan api error: unexpected status code: 400, {"code":400209,"message":"parameter config must be an array."}
我尝试对接口进行手动构建请求,可以按照预期返回。
示例:
curl 'https://cdn.api.baishan.com/v2/domain/config?token=token&domains=google.com&config[]=https'
响应体:
{
"code": 0,
"data": [
{
"domain": "google.com",
"domain_id": "106001",
"status": "serving",
"type": "dynamic",
"config": {
"https": {
"cert_id": 120610,
"http2": "on",
"force_https": "302",
"ocsp": "on"
}
}
}
]
}
The text was updated successfully, but these errors were encountered: