Skip to content

[Bug] Issue encountered when deploying certificates to child nodes via API #11309

@willow-god

Description

@willow-god

Contact Information

[email protected]

1Panel Version

2.0.15

Problem Description

最近在使用API实现部署SSL证书的过程中,遇到了同一脚本在不同平台上出现返回结果不一致的问题。

Steps to Reproduce

首先执行脚本:

#!/bin/bash
set -euo pipefail

ONEPANEL_URL="https://1p.example.com"
ONEPANEL_APIKEY="密钥"
ONEPANEL_SSLID="2"
ONEPANEL_NODE_NAME="节点名称"

timestamp=$(date +%s)
token=$(echo -n "1panel${ONEPANEL_APIKEY}${timestamp}" | md5sum | awk '{print $1}')

echo "== Debug 信息 =="
echo "URL: ${ONEPANEL_URL}/api/v2/websites/ssl/${ONEPANEL_SSLID}"
echo "Timestamp: $timestamp"
echo "Token: $token"
echo

response=$(curl -k -v -s -X GET \
  "${ONEPANEL_URL}/api/v2/websites/ssl/${ONEPANEL_SSLID}" \
  -H "CurrentNode: ${ONEPANEL_NODE_NAME}" \
  -H "1Panel-Timestamp: $timestamp" \
  -H "1Panel-Token: $token")

echo "== 返回内容 =="
echo "$response"

在linux环境下,非同一机器,经过测试可以正常获取到证书,如下:

Image

但是在Windows下,脚本不变,执行后确获得了500的请求:

Image

尝试在服务器内部查找日志进行调试,却发现,日志中的请求结果为200:

Image

请问这个具体是什么问题呢?

该问题在Certimate程序部署中似乎也能复现(个人),不确定其他机器是否有同样的问题。

我的面板反代使用了1panel面板的网站功能,通过Openresty实现。

The expected correct result

各种环境下均可以正常获取到证书,而不会返回500,我想理解这个500的报错是怎么回事。

Related log output

Additional Information

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions