title: Connection to Googleapis.com Refused
body: <p>I am developing an embedded c application on the nrf9160 dev kit.</p>
  <p>My goal is to use the googleapis.com/geolocation service to provide location data for my system, but I have been unable to do so.</p>
  <p>I have created a billing account on the google cloud platform, created an api key, and created and attempted to use a variety of https Certificates using the Certificate Authority Service, but I am unable to connect.</p>
  <p>Whenever I call the connect() function to attempt to connect to googleapis.com, I get a &quot;Connection Refused&quot; error.</p>
  <p>Here is the code that I am using:</p>
  <pre><code>err = cert_provision();
  if (err) {
      printk(&quot;getaddrinfo() failed, err %d\n&quot;, errno);
      return;
  }
  
  ((struct sockaddr_in *)res-&gt;ai_addr)-&gt;sin_port = htons(HTTPS_PORT);
  
  fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TLS_1_2);
  if (fd == -1) {
      printk(&quot;Failed to open socket!\n&quot;);
      goto clean_up;
  }
  
  /* Setup TLS socket options */
  err = tls_setup(fd);
  if (err) {
      goto clean_up;
  }
  
  printk(&quot;Connecting to %s\n&quot;, &quot;googleapis.com&quot;);
  err = connect(fd, res-&gt;ai_addr, sizeof(struct sockaddr_in));
  if (err) {
      printk(&quot;connect() failed, err: %d\n&quot;, errno);
      goto clean_up;
  }
  </code></pre>
  <p>Note: I have been able to connect to google.com and github.com using certificates specific to those sites.</p>
  <p>Help resolving this issue would be very appreciated.</p>