简体   繁体   English

通过对等方重置连接 - 将文件上载到另一个应用程序时出现SSL_connect错误

[英]Getting Connection reset by peer - SSL_connect error while uploading file to another app

Currently I have a rails application. 目前我有一个rails应用程序。 Now I have to implement functionality to upload a file to another application. 现在我必须实现将文件上传到另一个应用程序的功能。

The given application uses 3-legged oauth for security. 给定的应用程序使用3脚oauth来保证安全。 They have following architecture 他们有以下架构

I have able to create the FileID. 我能够创建FileID。 But while making PUT call (uploading file) getting the Errno::ECONNRESET: Connection reset by peer - SSL_connect error. 但是在进行PUT调用(上传文件)时,获取Errno::ECONNRESET: Connection reset by peer - SSL_connect错误。

So how can I upload the file in chunk. 那么如何以块的形式上传文件呢? Here is my sample code for uploading file. 这是我上传文件的示例代码。

file_data = File.open("/home/test/Downloads/RechargeReceipt.pdf") {|io| io.read}
file_data_64 = Base64.encode64(file_data)

access_token.put("/org/files/3156906966",
  { 'Content' => file_data_64 }.to_json,
  {
    'Accept' => 'application/vnd.axiom.v3+json', 
    'Content-Type' => 'application/octet-stream' 
  }
)

I am using rails 4. 我正在使用rails 4。

There is an issue while passing the body parameters. 传递body参数时出现问题。

data = File.read(params[:file].path)
access_token.put("/org/files/#{file_id}",
        data,
        {
          'Accept' => JohnDeere::ACCEPT,
          'Content-Type' => content_type
        }
      )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Redis / SideKiq / Rails连接被同级重置-SSL_connect - Redis/SideKiq/Rails Connection reset by peer - SSL_connect 连接重置连接 - 打开URL时SSL_connect - Connection reset by peer - SSL_connect when opening a URL http 方:`connect':连接由对等方重置 - SSL_connect (Errno::ECONNRESET) - http party: `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET) Ruby on Rails SSL_connect错误 - Ruby on Rails SSL_connect error 使用.p12文件ruby时获取SSL_connect…sslv3警报握手失败 - getting SSL_connect … sslv3 alert handshake failure when using .p12 file ruby 连接到 S3 时出现“SSL_connect 返回=1 errno=0 状态=错误:证书验证失败” - Getting “SSL_connect returned=1 errno=0 state=error: certificate verify failed” when connecting to S3 点击Google Contacts API时出现“通过对等方重置连接”错误 - getting a “connection reset by peer” error when hitting Google Contacts API 使用delay_job进程时发生SSL_connect错误 - SSL_connect error when using delayed_job processes Redmine:通过Gmail错误SSL_connect或STARTTLS发送邮件 - Redmine : send mail via gmail error SSL_connect or STARTTLS 发送邮件时发生错误(SSL_connect返回= 1 errno = 0状态= SSLv2 / v3读取服务器问候A:未知协议) - An error occurred while sending mail (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM