我正在尝试配置“通过 FTP 插件发布”以从 Jenkins (v2.7.4) 将文件上传到 FTP 站点(启用 SSL)。
在 FTP 主机配置(在管理 Jenkins > 配置系统下)中启用复选框“通过 TLS 使用 FTP”并添加“受信任的证书”。
“测试配置”成功,但文件上传失败并出现错误:“534 Policy requires SSL”
在下面找到控制台的详细输出:
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/jenkins_home/workspace/TEST_FTP
[TEST_FTP] $ /bin/sh -xe /opt/tomcat/temp/hudson6047550741121880978.sh
+ touch test.txt
FTP: Connecting from host [localhost]
FTP: Connecting with configuration [site1] ...
220 Welcome to XXXXXXXXXXXXXX FTP Services
AUTH TLS
234 AUTH command ok. Expecting TLS Negotiation.
FTP: Logging in, command printing disabled
FTP: Logged in, command printing enabled
CWD /site1/upload
250 CWD command successful.
TYPE I
200 Type set to I.
CWD /site1/upload
250 CWD command successful.
PASV
227 Entering Passive Mode (XX,XX,XX,XX,XX,XX).
STOR test.txt
534 Policy requires SSL.
FTP: Disconnecting configuration [site1] ...
ERROR: Exception when publishing, exception message [Could not write file. Server message: [534 Policy requires SSL.
]]
Build step 'Send build artifacts over FTP' changed build result to UNSTABLE
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: UNSTABLE
此插件是否需要任何其他配置才能工作?在维基页面中找不到任何具体说明:https://plugins.jenkins.io/publish-over-ftp
最佳答案
来自 RFC 2228 ,可能是安全级别不够。在命令端口上协商 TLS 对于该服务器来说可能还不够,如果还需要使用 PROT P 命令(在 PBSZ 命令之后)加密数据,那么您会遇到问题。
The server will reply 534 to a STOR, STOU, RETR, LIST, NLST, or APPE command if the current protection level is not at the level dictated by the server's security requirements for the particular file transfer.
您可以激活调试,然后我们可以通过在您的 Jenkins 启动中添加 -Djavax.net.debug=all 来确认握手一切正常,这是安全性不足的问题。
这个 Jenkins 插件似乎不支持数据通道加密。打开功能请求。
关于ssl - Jenkins “Publish over FTP plugin” 返回 “534 Policy requires SSL” 用于文件上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48516166/