SSL Certificate Error When Connecting to api2.cursor.sh
Description
When attempting to connect to api2.cursor.sh, I’m receiving an SSL certificate verification error. The server is presenting a certificate for *.us-east-1.es.amazonaws.com instead of api2.cursor.sh.
Steps to Reproduce
Attempting to connect to api2.cursor.sh:443
SSL handshake occurs but fails during certificate verification
Connection is closed with error: “SSL: no alternative certificate subject name matches target host name ‘api2.cursor.sh’”
Technical Details
The curl output shows:
Successfully connected to 18.210.68.197 (one of the resolved IPs for api2.cursor.sh)
TLSv1.2 connection established with ECDHE-RSA-AES128-GCM-SHA256
I hit the exact same issue and it looks like some CloudFront edge IPs that api2.cursor.sh resolves to are presenting the wrong TLS certificate. Until the Cursor team finishes fixing those edges, the workaround below forces your machine to use a “good” edge IP—one that already serves the correct api2.cursor.sh cert.
Locate a IP with OpenSSL (macOS / Linux)
for ip in $(dig +short api2.cursor.sh); do
echo -n "$ip "
openssl s_client -connect $ip:443 -servername api2.cursor.sh -brief < /dev/null 2>/dev/null \
| grep subject=
done
Look for a line that prints subject=CN = api2.cursor.sh—for example:
3.227.202.252 subject=CN = api2.cursor.sh
Pin that IP in /etc/hosts
sudo sh -c 'echo "3.227.202.252 api2.cursor.sh" >> /etc/hosts'
sudo dscacheutil -flushcache # macOS DNS cache
sudo killall -HUP mDNSResponder
When CloudFront shuffles traffic to new edges, that pinned IP may stop working or return a wrong cert again—you’ll need to repeat the steps with a new IP (or simply remove the hosts entry).
If you don’t want to touch the /etc/hosts files, you can try running Cursor through a VPN (WireGuard / OpenVPN) or enable DNS-over-HTTPS (e.g. Cloudflare 1.1.1.1). A tunnel avoids the broken edges
Hope this keeps you productive until the official fix lands!
I had exactly the same issue! however none of the ips from a dig from my machine were serving the correct cert.
I resorted to a online dig tool to look up an ip list in the hope it hit a different edge location, it did and the first one of those IP’s worked great.