HTTPS call using HTTP.query failing

I’m trying to call a simple request to an https server, but it’s failing. I suspect this is due to an outdated certificate in my ca.pem, but I can’t work out what certificate I need. However, what’s also really weird is that if I call the url using http, it works fine (as expected), but if I immediately then also call (which has exactly the same certificate chain and is hosted by the same company) it seems to work absolutely fine. The root certificate authority for both sites is USERTrust RSA Certification Authority

let ipURL = "";
      url: ipURL,
      success: function (body, full_http_msg) {
        let response = JSON.parse(body);
        li("IP: " + js(response.ip));
      error: function (err) {
      }, // Optional

Any ideas why this might not work, or which specific certificate I need to add/update in my ca.pem?