Has anyone received this error while working with ...
# developers
m
Has anyone received this error while working with Heroku and was able to resolve. cc: @Siddartha Kopparapu
Copy code
<https://next-auth.js.org/errors#client_fetch_error> request to <https://www.example.com/api/auth/session> failed, reason: Hostname/IP does not match certificate's altnames: Host: <http://www.example.com|www.example.com>. is not in the cert's altnames: DNS:*.<http://herokuapp.com|herokuapp.com>
z
I think @Agusti can know more
m
@Agusti can you help? This is preventing our users from logging in 😩
a
Hey there, have never run cal on heroku but seems like a missing .env var.
Nextauth url should be http://yourdomain:port . Do you have a domain setup or an aliad from heroku
Well https*
s
yes we have setup domain
a
Example.com is a placeholder domain. Thats why the ssl call fails Im guessing
s
No we just masked our domain here
we are getting error with our domain only
a
Let me check the env vars
https://github.com/calcom/cal.com/blob/main/.env.example # Required for Vercel hosting - set NEXTAUTH_URL to equal your BASE_URL # NEXTAUTH_URL='http://localhost:3000' NEXTAUTH_URL=
Try setting NEXTAUTH_URL=https://yourdomain.com
m
@Siddartha Kopparapu
a
In the heroku admin panel for env vars, and restarting the service
s
That is already done @Agusti
a
It's possible a reset is required for the env var to pick? Otherwise not sure why it's calling to example.com
It's possible that is set as your hostname somewhere in heroku? Again has been a while last time I deployed in heroku sorry!
Sorry
s
message: "request to https://www.mynorthstarre.com/api/auth/session failed, reason: Hostname/IP does not match certificate's altnames: Host: www.mynorthstarre.com. is not in the cert's altnames: DNS:*.herokuapp.com" is the error we are getting
a
did you change example.com
Okay gotcha now
I think what you're missing is a SSL certificate issued to your domain
Instead of re-using the ones from heroku, which are only authorized in heroku subdomains
Let's encrypt acme is usually the go to way for this, not sure with heroku how that would go https://letsencrypt.org/docs/client-options/
m
thanks agusti! have you done this with a google domain before? we are unable to download the google domain certificate .crt and .key for the manual uplaod
any chance you can hop on a video call? i know this isn't your job but we're really blocked right now and need someone to help us get past
a
Hey malavica, not really never used google domains. So usually I know how to do this on a VPS only. I think if you're running in heroku your options are a) if you're on a free dyno, use heroku subdomain b) on a paid dyno, use heroku ssl manager.