To one of Barry’s points, from hitting Google, file_get_contents() is known to have hiccups. Perhaps you could try the refactor as I indicate above and see what happens. If that fails then I think Barry has outlined any other possible issues as they relate to certificates.