Skip to content

Commit

Permalink
Dump summary to STDERR.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshi Nakamura committed May 5, 2011
1 parent 1ef7983 commit 6005224
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config.ru
Expand Up @@ -46,14 +46,16 @@ __EOS__
if tmpfile = file[:tempfile]
begin
uploaded = tmpfile.read
STDERR.puts "Uploaded #{uploaded.bytesize} bytes"
cert = OpenSSL::X509::Certificate.new(uploaded)
if hash = spki_sha1_hash(cert.to_der)
message = "Uploaded certificate: #{cert.subject}<br/>\n" +
"Public key fingerprint for Chrome HSTS preloading:<br/>\n" +
" => " + hash
STDERR.puts [hash, cert.subject].join("\t")
end
rescue Exception => e
message = e.inspect
message = [e.class, e.message].join(" ")
end
else
message = 'Uploading failure'
Expand Down

0 comments on commit 6005224

Please sign in to comment.