我试图通过Net :: FTPTLS连接到基于Microsoft的文件服务器(IIS),该服务器被配置为在端口22上使用FTP并需要SSL。使用Net :: FTPTLS连接到服务器证书不匹配的FTPS服务器
我连接通过:
require 'net/ftptls'
ftp = Net::FTPTLS.new()
ftp.connect('host.com', port_number)
ftp.login('Username', 'Password')
ftp.puttextfile('somefile.txt', 'where/to/save/somefile.txt')
ftp.close
问题是,我得到以下错误:
hostname does not match the server certificate
看来我必须禁用OpenSSL的对等认证:OpenSSL的:: SSL :: VERIFY_PEER应该成为OpenSSL :: SSL :: VERIFY_NONE。
有关如何修补Net :: FTPTLS类的任何想法?有没有人成功做到这一点?
我建议这个答案添加更多的信息。 –
这不提供问题的答案。一旦你有足够的[声誉](https://stackoverflow.com/help/whats-reputation),你将可以[对任何帖子发表评论](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提问者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- I-DO-代替)。 - [来自评论](/ review/low-quality-posts/18602355) –