certificate - WinSCP - 自动接受任何证书
问题描述
我正在使用带有如下脚本文件的 WinSCP 命令行实用程序(从 SSIS 启动):
option confirm off
open ftps://user:pw@ftp.host.com:3221/root -certificate=*
put \\path\to\file\Stores.zip
put \\path\to\file\Products.zip
put \\path\to\file\Inventory.zip
exit
当我运行它时,它没有完成 - 如果我检查日志,我会看到:
. 2018-05-11 10:27:16.413 Connecting to ftp.host.com:3221 ...
. 2018-05-11 10:27:16.546 Connected with ftp.host.com:3221, negotiating SSL connection...
. 2018-05-11 10:27:17.044 Asking user:
. 2018-05-11 10:27:17.045 The server's certificate is not known. You have no guarantee that the server is the computer you think it is. Server's certificate details follow:
. 2018-05-11 10:27:17.045
. 2018-05-11 10:27:17.046 Issuer:
. 2018-05-11 10:27:17.047 - Organization: Host, Inc., *.host.com
. 2018-05-11 10:27:17.048 - Location: US, State, City
. 2018-05-11 10:27:17.048
. 2018-05-11 10:27:17.053 Subject:
. 2018-05-11 10:27:17.058 - Organization: CertOrg
. 2018-05-11 10:27:17.060 - Location: US
. 2018-05-11 10:27:17.066
. 2018-05-11 10:27:17.068 Valid: 7/14/2017 12:00:00 AM - 8/29/2018 12:00:00 PM
. 2018-05-11 10:27:17.074
. 2018-05-11 10:27:17.075 Fingerprint (SHA1): ##################
. 2018-05-11 10:27:17.075
. 2018-05-11 10:27:17.076 Summary: Unable to get local issuer certificate. The error occured at a depth of 1 in the certificate chain.
. 2018-05-11 10:27:17.076
. 2018-05-11 10:27:17.077 If you trust this certificate, press Yes. To connect without storing certificate, press No. To abandon the connection press Cancel.
. 2018-05-11 10:27:17.080
. 2018-05-11 10:27:17.081 Continue connecting and store the certificate? ()
根据-certificate=*
我在文档中收集的内容,应该自动推动接受。我在这里缺少什么吗?我也尝试过hostkey=*
产生相同的结果,并且同时使用主机密钥和证书标志会导致错误。
任何帮助是极大的赞赏。
解决方案
如果没有看到完整的会话日志文件,很难回答这个问题。
但我的猜测是你使用了一些不支持*
in -certificate
(早于 5.2)或根本不支持-certificate
switch(早于 4.2.2)的旧版本的 WinSCP。
使用最新版本的 WinSCP,您的脚本应该可以正常工作。
不用说,通过使用*
,您将失去对MITM 攻击的保护!
推荐阅读
- visual-studio-code - 如何让 CTRL+K CTRL+E 在终端中工作
- android - 使用绘制对象android的TextAlignment
- r - 离散变量并提供限制
- kivy - 在 Kivy 中是否有某种方式可以在触摸许多不同的行时调用不同的操作
- python - OpenPyXL - 从行列表中的特定行输入值
- kotlin - 如何在 kotlin-exposed 中编写 insideOP postgis 扩展?
- reactjs - 为什么 useSelector 返回新对象?
- ansible - ansible 将远程 nfs 共享挂载到运行 ansible playbook 的 localhost 服务器
- typescript - 在 Typescript 中扩展泛型类型
- next.js - NextJS 中的 FOUC 使用 Tailwind Css