Git Product home page Git Product logo

double-bag-ftps's Introduction

DoubleBagFTPS

DoubleBagFTPS extends the core Net::FTP class to provide implicit and explicit FTPS support.

Install

$ [sudo] gem install double-bag-ftps

Note: Your Ruby installation must have OpenSSL support.

Usage

require 'double_bag_ftps'

Example 1:

# Connect to a host using explicit FTPS and do not verify the host's cert
ftps = DoubleBagFTPS.new
ftps.ssl_context = DoubleBagFTPS.create_ssl_context(:verify_mode => OpenSSL::SSL::VERIFY_NONE)
ftps.connect('some host')
ftps.login('usr', 'passwd')

Example 2:

DoubleBagFTPS.open('host', 'usr', 'passwd', nil, DoubleBagFTPS::IMPLICIT) do |ftps|
  ...
end

Interface

# Constants used for setting FTPS mode
DoubleBagFTPS::EXPLICIT
DoubleBagFTPS::IMPLICIT

DoubleBagFTPS.new(host = nil, user = nil, passwd = nil, acct = nil, ftps_mode = EXPLICIT, ssl_context_params = {})
DoubleBagFTPS.open(host, user = nil, passwd = nil, acct = nil, ftps_mode = EXPLICIT, ssl_context_params = {})

# Returns an OpenSSL::SSL::SSLContext using params to set set the corresponding SSLContext attributes.
DoubleBagFTPS.create_ssl_context(params = {})

# Set the FTPS mode to implicit (DoubleBagFTPS::IMPLICIT) or explicit (DoubleBagFTPS::EXPLICIT).
# The default FTPS mode is explicit. 
ftps_mode=(ftps_mode)

# Same as Net::FTP.connect, but will use port 990 when using implicit FTPS and a port is not specified.
connect(host, port = ftps_implicit? ? IMPLICIT_PORT : FTP_PORT)

# Same as Net::FTP.login, but with optional auth param to control the value that is sent with the AUTH command.
login(user = 'anonymous', passwd = nil, acct = nil, auth = 'TLS')

ftps_explicit?
ftps_implicit?

More Information

License

Copyright © 2011, Bryan Nix. DoubleBagFTPS is released under the MIT license. See LICENSE file for details.

double-bag-ftps's People

Contributors

bnix avatar wconrad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.