Suddenly getting 403 forbidden error

Using go-ethereum to connect to rinkeby testnet but getting:
websocket: bad handshake (HTTP status 403 Forbidden)

code snippet:

client, err := ethclient.Dial(“wss://”)

The code simply returns me a websocket client object using which I can perform transactions. It was working properly till yesterday.

Hello @rsjethani , the solution is to set up go-ethereum to use your API key, which has to be v3 . You can follow the Getting Started guide here to create your v3 API key.

Thanks for your reply, but how it worked earlier? and not now?? also the error is only coming when using websocket api, with http api it is working

The generic API endpoint was deprecated in July 2018 and removed today. Here’s a post describing in more detail:

OH!! thanks for that.

Hi I have the same problem. Yesterday (10 feb 2020) I started to get error 403 when getting new blocks and transactions. I had no problem before. I use v3. My access token is 11 month old.
I still continue to receive block headers but suddenly getting error 403 for any request (block or transactions).
I tried to create a new access_token without a difference.
Any idea ?

Hi @jfjobidon can you provide us with the full body of the 403 HTTP error response you’re getting?