๐Ÿ”ฎ Sanity Create is here. Writing is reinvented. Try now, no developer setup

Error fetching data from sanity-client, SSL certificate issue

17 replies
Last updated: May 10, 2021
While using sanity-client to fetch data from sanity I'm getting this error! Does anyone saw this before ??
May 10, 2021, 7:15 AM
Hi
user E
, thanks for sharing! I don't think I've seen this before. Could you show how you're using the client to fetch the data?
May 10, 2021, 7:19 AM
Here is the simple example of it
May 10, 2021, 7:29 AM
Thanks! We'll investigate ๐Ÿ™‚
May 10, 2021, 7:31 AM
Thanks
May 10, 2021, 7:31 AM
Is there any chance the clock on this machine is not showing the current date and time?
May 10, 2021, 7:37 AM
Is there any chance the clock on this machine is not showing the current date and time?
May 10, 2021, 7:37 AM
๐Ÿ˜… I also confirmed this first and it's showing the updated date and time
May 10, 2021, 7:38 AM
It was working fine before and suddenly it starts failing
May 10, 2021, 7:41 AM
Thanks for confirming it's not a local clock issue ๐Ÿ™‚ Could you run this command and share the results with us?
curl -v <https://api.sanity.io/>
May 10, 2021, 7:44 AM
curl -v https://api.sanity.io/ * Trying 35.241.31.122:443...
* TCP_NODELAY set
* Connected to
api.sanity.io (35.241.31.122) port 443 (#0)* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, bad certificate (554):
* SSL certificate problem: certificate is not yet valid
* Closing connection 0
curl: (60) SSL certificate problem: certificate is not yet valid
More details here:
https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
May 10, 2021, 7:45 AM
I can confirm that's different from the output I'm seeing here. Let's try to figure out why. Could you run
date
and give the output, just in case?
May 10, 2021, 7:48 AM
It's not correct here
May 10, 2021, 7:49 AM
I'm using WSL in windows
May 10, 2021, 7:50 AM
Ah, that would explain then ๐Ÿ™‚ We renewed on the 8th so this date is too early for the cert
May 10, 2021, 7:50 AM
Working now, Thanks for your help
May 10, 2021, 7:56 AM
Great to hear, thanks for confirming!
May 10, 2021, 7:59 AM
Great to hear, thanks for confirming!
May 10, 2021, 7:59 AM

Sanityโ€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?