Fixes a bug that causes authentication errors when using a self-signed certificate