使用WinSCP传输文件时,报错:
Unable to get local issuer certificate. The error occurred at a depth of 2 in the certificate chain.
服务器 /etc/proftpd.conf 文件的 TLS 部分配置如下。
TLSEngine on TLSRequired off #TLSRSACertificateFile /etc/ssl/certs/certificate.crt TLSRSACertificateKeyFile /etc/ssl/certs/private.key #TLSCACertificateFile /etc/ssl/certs/intermediate.ca TLSCipherSuite ALL:!ADH:!DES TLSCertificateChainFile /etc/ssl/certs/concatenation.crt TLSVerifyClient off TLSLog /var/log/proftpd/tls.log
开始指定了 TLSRSACertificateFile 和 TLSCACertificateFile,如上所示,但将它们注释掉并替换为 TLSCertificateChainFile。
此处指定的文件是我从 GeoTrust 颁发的证书的串联,后跟还提供的中间 CA。
WinSCP使用OpenSSL来验证证书,函数pSSL_CTX_load_verify_locations指定了可信CA证书的位置。
在这个例子中,我们可以看到它在与运行模块相同的位置使用了一个名为 cacert.pem 的文件。
基本上 WinSCP 不附带预先信任的证书,出于安全原因,要使用来自 Windows 商店的证书。
为了解决这个问题,我添加了来自 http://curl.haxx.se/ca/ 的所有 Firefox CA
只需从上面的链接下载 cacert.pem 并将其放在与 winscp.exe 相同的文件夹中,然后当我们尝试使用具有证书的 FTPS 连接到服务器时,我们应该不会收到任何证书警告。
日期:2020-07-07 20:56:53 来源:oir作者:oir