[GH-ISSUE #848] [Bug] 当Certimate部署在Linux时,使用反斜杠路径向Windows机器上传证书失败 #577

Closed
opened 2026-03-03 01:04:25 +03:00 by kerem · 0 comments
Owner

Originally created by @JiangJamm on GitHub (Jul 4, 2025).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/848

软件版本 / Release Version

v0.3.21

缺陷描述 / Description

Image Image

可以看到,传入的path已经转换为\\分隔符的路径,但没办法被filepath.Dir()识别,因此方法返回值为.,估计这是导致上传错误的主要原因。
github.com/certimate-go/certimate@400e30f633/pkg/core/ssl-deployer/providers/ssh/ssh.go (L422-L424)
Image

复现步骤 / Steps to reproduce

  1. 将Certimate部署到Linux机器中
  2. 使用Certimate申请证书并将证书通过ssh部署到Windows机器中
  3. 工作流报错

日志 / Logs

[2025-07-05 03:00:35]
ready to deploy certificate ...
config:
{"certificate":"AC_utcxQhPpFvJwiguGC8#certificate","provider":"ssh","providerAccessId":"19kx8436sxrjckn","providerConfig":{"certPath":"C:\\Users\\haozi\\Documents\\test7\\certimate\\cert7.crt","format":"PEM","keyPath":"C:\\Users\\haozi\\Documents\\test7\\certimate\\cert7.key"},"skipOnLastSucceeded":false}
[2025-07-05 03:00:35]
ssh connected
[2025-07-05 03:01:16]
failed to deploy certificate
[2025-07-05 03:01:16]
failed to upload certificate file: failed to open remote file: file does not exist

其他 / Miscellaneous

No response

贡献 / Contribution

  • 我乐意为此贡献 PR! / I am interested in contributing a PR for this!
Originally created by @JiangJamm on GitHub (Jul 4, 2025). Original GitHub issue: https://github.com/certimate-go/certimate/issues/848 ### 软件版本 / Release Version v0.3.21 ### 缺陷描述 / Description <img width="1086" height="903" alt="Image" src="https://github.com/user-attachments/assets/e3b693da-0b87-4d10-bd94-be7476901449" /> <img width="1095" height="1908" alt="Image" src="https://github.com/user-attachments/assets/3127b80c-f7b0-49e5-a8ce-09f4a927acdf" /> 可以看到,传入的`path`已经转换为`\\`分隔符的路径,但没办法被`filepath.Dir()`识别,因此方法返回值为`.`,估计这是导致上传错误的主要原因。 https://github.com/certimate-go/certimate/blob/400e30f633dff2b4436699ca9d9eb8664292fb05/pkg/core/ssl-deployer/providers/ssh/ssh.go#L422-L424 <img width="1926" height="1332" alt="Image" src="https://github.com/user-attachments/assets/ea61a445-ad22-4547-bf9a-a8aaadc7f019" /> ### 复现步骤 / Steps to reproduce 1. 将Certimate部署到**Linux**机器中 2. 使用Certimate申请证书并将证书通过**ssh部署**到Windows机器中 3. 工作流报错 ### 日志 / Logs <details> ```console [2025-07-05 03:00:35] ready to deploy certificate ... config: {"certificate":"AC_utcxQhPpFvJwiguGC8#certificate","provider":"ssh","providerAccessId":"19kx8436sxrjckn","providerConfig":{"certPath":"C:\\Users\\haozi\\Documents\\test7\\certimate\\cert7.crt","format":"PEM","keyPath":"C:\\Users\\haozi\\Documents\\test7\\certimate\\cert7.key"},"skipOnLastSucceeded":false} [2025-07-05 03:00:35] ssh connected [2025-07-05 03:01:16] failed to deploy certificate [2025-07-05 03:01:16] failed to upload certificate file: failed to open remote file: file does not exist ``` </details> ### 其他 / Miscellaneous _No response_ ### 贡献 / Contribution - [ ] 我乐意为此贡献 PR! / I am interested in contributing a PR for this!
kerem 2026-03-03 01:04:25 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#577
No description provided.