--- open-uri.rb (saved version) +++ (current document) @@ -651,8 +651,12 @@ # The access sequence is defined by RFC 1738 ftp = Net::FTP.open(self.host) # todo: extract user/passwd from .netrc. - user = 'anonymous' - passwd = nil + if options.include? :http_basic_authentication + user, passwd = options[:http_basic_authentication] + else + user = 'anonymous' + passwd = nil + end user, passwd = self.userinfo.split(/:/) if self.userinfo ftp.login(user, passwd) directories.each {|cwd|