Error fetching data from sanity-client, SSL certificate issue
17 replies
Last updated: May 10, 2021
P
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
P
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
P
Here is the simple example of it
May 10, 2021, 7:29 AM
P
Thanks! We'll investigate π
May 10, 2021, 7:31 AM
P
Thanks
May 10, 2021, 7:31 AM
P
Is there any chance the clock on this machine is not showing the current date and time?
May 10, 2021, 7:37 AM
P
Is there any chance the clock on this machine is not showing the current date and time?
May 10, 2021, 7:37 AM
P
π
I also confirmed this first and it's showing the updated date and time
May 10, 2021, 7:38 AM
P
It was working fine before and suddenly it starts failing
May 10, 2021, 7:41 AM
P
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
P
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.
* 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
P
I can confirm that's different from the output I'm seeing here. Let's try to figure out why. Could you run
dateand give the output, just in case?
May 10, 2021, 7:48 AM
P
It's not correct here
May 10, 2021, 7:49 AM
P
I'm using WSL in windows
May 10, 2021, 7:50 AM
P
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
P
Working now, Thanks for your help
May 10, 2021, 7:56 AM
P
Great to hear, thanks for confirming!
May 10, 2021, 7:59 AM
P
Great to hear, thanks for confirming!
May 10, 2021, 7:59 AM
Sanityβ build remarkable experiences at scale
The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.