我試圖通過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) –