Fix certificate chain when creating certificate message.

- Closes #39.
- Thanks @mstrum.