Websocket stopped receiving data all of a sudden

No code changes. Websocket has been running for months fine. Last Thursday (yesterday) all of a sudden data stopped arriving. It is connecting, it is authenticating, no error messages - and no data. Upgraded to a paid account just to see if it’d make a difference (it didn’t), changed the API keys, but this morning, same behavior. Anyone have an idea how/where to proceed from here?

1 Like

Did you change the source from ‘iex’ to ‘sip’ after upgrading to a paid account?

Yes i did. I think it is some sort of SSL issue though. I wrapped _connect call in stream.py with a try/catch and sure enough this exception is thrown:

Exception from websocket connection: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)

Not sure what certificate it is referring to. I do not recalling installing any certificates to use the Alpaca API.

Did you resolve your issue? I had a similar one happen to me and just managed to figure it out. Read my last post if you need help still, it might work.

Yes. It was related to this:

I deleted all expired DST Root CA X3 certificates and we’re good to go.

1 Like

hey @maciejg @esp
I am a beginner when it comes to thse SSL certificates, would you mind sharing the exact steps to be done for deleting these DST Root CA X3 certificates - from a Windows machine.

Thank you very much.

You can find details in community slack (click on the link below):

Sure, just run Certificate Manager on Windows (I typed ‘cert’ in the windows search bar and “Manage Computer Certificates” / “Control Panel” popped as a first choice). In there, I went through all of them looking for the ones named “DST Root CA X3”, then highlight, right click, and ‘delete’. The most important are Trusted Root Certification Authorities and Third Party Root Certification Authorities. You can also sort by expiration date. The one that caused problems expired on 9/30/2021.

Thanks @maciejg - I followed the steps and deleted the certificate from both Trusted Root Certification Authorities and Third Party Root Certification Authorities . but look like windows 10 just automatically reinstalls the “DST Root CA X3” certificates.

I also looked at another post on this SSLCertVerificationError using python SDK - #5 by kellytmcnallan

Where they suggested simply deleting the “DST Root CA X3” from the pem file (which is a text file that python uses for storing certificates). Got the location of the pem file by running the following commands.

import certifi

I still get the same certificate verify failed error. Any thoughts?

Hello @satejchaudhary,

I am new on this stuff and experiencing the exactly the same issue. Did you get a solution for this?

Thank you!

Hi ,
I am getting the same error for cerificate even after deleting the DST Root CA X3 , and removing the entry in cacert.pem for python …file. Please let me know if anyone has any working solution…

Python 3.9.2
Windows - 10
Everytime I delete the DSA Root , it is populating again in cerificates… even after deleting the entry at cacert.pem

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1123)
INFO:alpaca_trade_api.stream:starting crypto data websocket connection

Anyone found any solution for it ? Please help…

I’ve been having this problem for some time, been going crazy trying to fix it, dont really know much about SSL certificates, anyone found a solution?

Hi, If you’re using python, you can pip install --upgrade certifi , that should resolve your issue.