Fix for self-signed certificates

Change-Id: I529976e6fc8813d273290e97e86405f51c3efa57
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>