working example with self-signed certificates