[curl] build fixes and improve ssl handling

Improve detecting and handling of SSL related errors

Buildfix after merging the Bug 124150 - Rename PlatformCertificateInfo to CertificateInfo.