lib/httpi/adapter/em_http.rb
# The default directory where certificates are saved to temporary files.
The default directory where certificates are saved to temporary files.
The default directory where certificates are saved to temporary files .
def cert_and_key_file(ssl)
        contents = []
        contents << File.read(ssl.cert_key_file) if ssl.cert_key_file
        contents << File.read(ssl.cert_file) if ssl.cert_file
        contents = contents.compact.map(&:to_s).map(&:chomp).join("\n")
        return if !contents || contents.empty?
        FileUtils.mkdir_p(cert_directory)
        filename = "#{cert_directory}/em_http.#{Digest::SHA1.hexdigest contents}.tmp"
        unless File.exist?(filename)
          File.open(filename, 'w') do |f|
            f.print contents.to_s
          end
        end
        filename
      end
def cert_and_key_file ( ssl ) contents = [ ] contents << File . read ( ssl . cert_key_file ) if ssl . cert_key_file contents << File . read ( ssl . cert_file ) if ssl . cert_file contents = contents . compact . map ( & :to_s ) . map ( & :chomp ) . join ( "\n" ) return if ! contents || contents . empty? FileUtils . mkdir_p ( cert_directory ) filename = "#{cert_directory}/em_http.#{Digest::SHA1.hexdigest contents}.tmp" unless File . exist? ( filename ) File . open ( filename , 'w' ) do | f | f . print contents . to_s end end filename end
The default directory where certificates are saved to temporary files.
The default directory where certificates are saved to temporary files .
ssl