FTPS (TLS/SSL) from Ruby on Rails App

后端 未结 6 1906
清酒与你
清酒与你 2021-01-04 05:40

I have an FTP server which only accepts connections through running FTPS (explicit FTP over TLS). I need to be able to connect to this using a Ruby on Rails app.

6条回答
  •  粉色の甜心
    2021-01-04 06:36

    EDIT: I figured out how to get it running locally, but am having issues getting it to work on Heroku. That's a bit of a departure from this question, so I've created a new one:

    Heroku with FTPTLS - Error on SSL Connection

    require 'net/ftptls'
    ftp = Net::FTPTLS.new()
    ftp.passive = true
    #make sure you define port_number
    ftp.connect('host.com', port_number)
    ftp.login('Username', 'Password')
    ftp.gettextfile('filename.ext', 'where/to/save/file.ext')
    ftp.close
    

提交回复
热议问题