草庐IT

ftp_ssl_connect

全部标签

ruby-on-rails - 配置 WEBrick 以使用自动生成的自签名 SSL/HTTPS 证书

我想使用SSL/HTTPS在本地开发我的RubyonRails应用程序,但我在尝试设置服务器以使用SSL时遇到了问题。以下是我到目前为止已经尝试过的事情:rails服务器[选项]railsserver命令没有ssl选项(railsserver--help):Usage:railsserver[mongrel,thin,etc][options]-p,--port=portRunsRailsonthespecifiedport.Default:3000-b,--binding=ipBindsRailstothespecifiedip.Default:0.0.0.0-c,--config=

ruby - 如何在不先保存文本文件的情况下在 Ruby 中使用 FTP

由于Heroku不允许将动态文件保存到磁盘,我遇到了一个难题,希望您能帮助我克服。我有一个可以在RAM中创建的文本文件。问题是我找不到允许我将文件流式传输到另一个FTP服务器的gem或函数。我使用的Net/FTPgem要求我先将文件保存到磁盘。有什么建议吗?ftp=Net::FTP.new(domain)ftp.passive=trueftp.login(username,password)ftp.chdir(path_on_server)ftp.puttextfile(path_to_web_file)ftp.closeftp.puttextfile函数要求物理文件存在。

ruby-on-rails - postgresql 数据库错误 : Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

当我运行rakedb:migrate或运行railss命令时,我得到同样的错误:Error:couldnotconnecttoserver:NosuchfileordirectoryIstheserverrunninglocallyandacceptingconnectionsonUnixdomainsocket"/var/run/postgresql/.s.PGSQL.5432"?当我尝试railss时,浏览器出现错误。这是我的database.ymldefault:&defaultadapter:postgresqlencoding:unicodepool:5development

ruby - 为什么 Net::FTP 无法连接到服务器?

我正在尝试创建一个脚本来使用Ruby从FTP服务器列出和下载数据。我是Ruby的新手,所以我查找了如何使用Net::FTP的文档。我无法理解为什么这不起作用:require'net/ftp'server="ftp.server.com"user="myuser"password="mypassword"Net::FTP.open(server,user,password)do|ftp|files=ftp.chdir('mydirectory/')files=ftp.listputs"listoutofdirectory:"putsfilesend那行不通,返回这个错误:/home/ad

ruby - 连接:SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

我在获取SSL来验证证书时遇到了麻烦。我完全不知道证书是如何工作的,所以这是一个主要的障碍。这是我在运行脚本时遇到的错误:c:/Ruby191/lib/ruby/1.9.1/net/http.rb:611:in`connect':SSL_connectreturned=1errno=0state=SSLv3readservercertificateB:certificateverifyfailed(OpenSSL::SSL::SSLError)相关代码如下:client=Savon::Client.neworder_svcrequest=client.create_empty_cart

ruby-on-rails - 为 rails 中的特定 Controller 跳过/禁用 force_ssl

除了message#newController之外,我需要在我的应用程序中的所有路由上强制使用SSL。在config/environments/production.rb中,我有:config.force_ssl=true现在所有路由都重定向到https,现在我想为message#newController禁用它。有谁知道如何为Rails4+应用程序中的特定Controller禁用强制SSL? 最佳答案 根据documentation以下应该有效(但仅适用于rails>5版本):config.ssl_options={redirec

ruby-on-rails - Heroku Rails 部署失败,错误为 "could not connect to server: Connection refused"

在本地一切正常,但是当我尝试推送到heroku时出现错误:Running:rakeassets:precompileConnectingtodatabasespecifiedbyDATABASE_URLrakeaborted!couldnotconnecttoserver:ConnectionrefusedIstheserverrunningonhost"127.0.0.1"andacceptingTCP/IPconnectionsonport5432?/tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/

ruby - 尝试通过 SSL 创建一个简单的 Ruby 服务器

我正在尝试用Ruby创建一个简单的SSL客户端和服务器。但是我收到了一条神秘的错误消息,文档也没有帮助。这是我的服务器代码:#!/usr/bin/rubyrequire"gserver"require"openssl"listeningPort=Integer(ARGV[0])classServer"+lineInlineOut="Yousaid:"+lineIn$stdout.puts"客户端代码类似:#!/usr/bin/rubyrequire"socket"require"thread"require"openssl"host=ARGV[0]port=Integer(ARGV[1

ruby-on-rails - 来自 Ruby on Rails 应用程序的 FTPS (TLS/SSL)

我有一个FTP服务器,它只接受通过运行FTPS(基于TLS的显式FTP)的连接。我需要能够使用RubyonRails应用程序连接到它。有人知道执行此操作的方法吗?我已经尝试了Net::FTP库,但这似乎不支持FTPS连接。 最佳答案 使用Net::FTPTLS怎么样? 关于ruby-on-rails-来自RubyonRails应用程序的FTPS(TLS/SSL),我们在StackOverflow上找到一个类似的问题: https://stackoverflow

ruby - 如果运行了 tls_start,EventMachine 会在 close_connection 上发出 close_notify 吗?

我正在尝试编写一个基于EventMachine的简单FTPS服务器。控制socket工作正常。当使用数据套接字进行数据传输时,似乎一切正常(TLS握手成功完成并接收到数据),但随后我收到一条错误消息。这是我在Filezilla中得到的:Command:LISTResponse:150OpeningASCIImodedataconnectionforfilelistTrace:CFtpControlSocket::TransferParseResponse()Trace:code=1Trace:state=4Trace:CFtpControlSocket::SendNextCommand