ssl: Validate hostnames

Closes #524
use bool instead of int for boolean
merge from hexchat master