Generating TLS Header in pure javascript.