Add hostname checking

Also remove some trailing whitespace
Merge branch 'bug/ssl_hostname_check' of git://github.com/chiiph/soledad into develop