[Core] Backport HTTPS fixes from md-addins
[Core] Null-check credentials