[stable7] Check for cert bundle existence before using it

Stable7 backport of https://github.com/owncloud/core/pull/11949

Sent as PR due to conflicts.

Please review @icewind1991 @LukasReschke @karlitschek 

@jospoortvliet if you like you could patch your server with this PR