How do you perform double-SHA-256 encoding? The Bitcoin Protocol-specification gives an example of double-SHA-256 encoding. 


  hello
  2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256)
  9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50 (second round of sha-256)


I've tried various SHA256 calculators and the first encoding matches no problem, but the second always resolves to


  d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9


I've also tried UPPERCASE and swapping the byte endianness.
You're hashing the hexadecimal representation of the first hash. You need to hash the actual hash -- the binary data that the hex represents.

Try this:

$ echo -n hello |openssl dgst -sha256 -binary |openssl dgst -sha256