title: Paperclip processor timeout on S3
body: <p>I'm inserting a digital signature into a pdf file inside my processor, but keep getting an <code>AWS::S3::ERRORS::Requestimeout</code> error. What is this timeout? Is there any way i could keep the connection open until the file gets uploaded ? </p>
  
  <blockquote>
    <p>Your socket connection to the server was not read from or written to
    within the timeout period. Idle connections will be closed.</p>
  </blockquote>
  
  <p>Here is my code : </p>
  
  <p>model:</p>
  
  <pre><code>...
  
  has_attached_file :receipt_file,
                      :storage =&gt; :s3,
                      :s3_credentials =&gt; "#{Rails.root}/config/s3.yml",
                      :path =&gt; "/:style/:id/:filename",
                      :s3_protocol =&gt; "https",
                      :styles =&gt; {dummy:""},
                      processors: [:SignPdf]
   #process_in_background :receipt_file
  
  ...
  </code></pre>
  
  <p>Processor</p>
  
  <pre><code>module Paperclip
  
  
      class SignPdf &lt; Processor
        attr_accessor :receipt_id,:style
       S3_CONFIG = YAML.load_file("#{::Rails.root}/config/s3.yml")[Rails.env]
       ORIGAMIDIR = "/ruby/1.9.1/gems/origami-1.2.4/lib"
  
  
        def initialize(file, options = {}, attachment = nil)
          @file           = file
          @current_format = File.extname(@file.path)
          @basename       = File.basename(@file.path, @current_format)
          @attachment = attachment
        end
  
          def make
  
           signPdf(@file) 
           @file
        end
  
      end
  end
  
  begin
    require 'origami'
  rescue LoadError
    $: &lt;&lt; ORIGAMIDIR
    require 'origami'
  end
  include Origami
  def signPdf(file)
  
          certFile = "#{::Rails.root}/lib/assets/Cert.pem"
          rsakeyFile = "#{::Rails.root}/lib/assets/pk.pem"
          passphrase = "o2Receipts"
  
          key4pem=File.read rsakeyFile
          key = OpenSSL::PKey::RSA.new key4pem, passphrase
          cert = OpenSSL::X509::Certificate.new(File.read certFile)
  
          pdf = PDF.read(file)
          page = pdf.get_page(1)
  
          # Add signature annotation (so it becomes visibles in pdf document)
  
          sigannot = Annotation::Widget::Signature.new
          sigannot.Rect = Rectangle[:llx =&gt; 89.0, :lly =&gt; 386.0, :urx =&gt; 190.0, :ury =&gt; 353.0]
  
          page.add_annot(sigannot)
  
          # Sign the PDF with the specified keys
          pdf.sign(cert, key, 
            :method =&gt; 'adbe.pkcs7.sha1',
            :annotation =&gt; sigannot, 
            :location =&gt; "Portugal", 
            :contact =&gt; "email@email.pt", 
            :reason =&gt; "Proof of Concept"
          )
  
          # Save the resulting file
          pdf.save(file.path)
          file
  end      
  </code></pre>