Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Getting a certificate error when using PHP and CURL to get authorization token

Solved!

Getting a certificate error when using PHP and CURL to get authorization token

I have a PHP script that was working up until fairly recently. It uses CURL to get and authorization token to access the API. The error I am receiving is:

Error:SSL: certificate subject name '*.wg.spotify.com' does not match target host name 'accounts.spotify.com'

 

Is there a problem with the certificate or has there been a change and I will need to adjust my code?

Reply

Accepted Solutions
Marked as solution

Spotify changed their DNS configuration.  Now accounts.spotify.com is an alias for edge-web-russia.dual-gslb.spotify.com and api.spotify.com is an alias for edge-web.dual-gslb.spotify.com.  Both edge-web servers have the same IP address and they both present the same https certificate which identifies the host as wg.spotify.com.  I suppose wg stands for Web Gateway.

 

So if you have curl set to verify the certificate then it will fail with a verification error, since the name on the certificate does not match the name of the https host that you are connecting to.  You can use the --insecure option to disable verification.

 

You would think that Spotify could manage to provide each of the hosts that they use for their API endpoints with certificates that match the host name, especially since it would be free and automatic to do that with LetsEncrypt.  Maybe their webmaster is just too busy doing other things to get around to finishing the job of setting up the new API hosts.

 

This issue was also reported here. That report indicates that the change occurred on 1 July.

View solution in original post

2 Replies
Marked as solution

Spotify changed their DNS configuration.  Now accounts.spotify.com is an alias for edge-web-russia.dual-gslb.spotify.com and api.spotify.com is an alias for edge-web.dual-gslb.spotify.com.  Both edge-web servers have the same IP address and they both present the same https certificate which identifies the host as wg.spotify.com.  I suppose wg stands for Web Gateway.

 

So if you have curl set to verify the certificate then it will fail with a verification error, since the name on the certificate does not match the name of the https host that you are connecting to.  You can use the --insecure option to disable verification.

 

You would think that Spotify could manage to provide each of the hosts that they use for their API endpoints with certificates that match the host name, especially since it would be free and automatic to do that with LetsEncrypt.  Maybe their webmaster is just too busy doing other things to get around to finishing the job of setting up the new API hosts.

 

This issue was also reported here. That report indicates that the change occurred on 1 July.

Than you for this. I was able to resolve this issue as per your suggestion.

Suggested posts

Type a product name