Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to connect to Charles Schwab Bank/Charles Schwab Brokerage on python3 #71

Open
eamsden opened this issue Apr 25, 2019 · 2 comments

Comments

@eamsden
Copy link

eamsden commented Apr 25, 2019

I have a laptop running Ubuntu 18.04 and python 2.7. On this laptop ofxclient 2.0.2 will successfully connect to Charles Schwab Bank and Charles Schwab brokerage and download my account data via OFX.

On my desktop, running NixOS unstable, ofxclient is run with Python 3.7.3 and is version 2.0.3 (latest from PyPI). Here I consistently receive the error:

  File "/<nixpath>/lib/python3.7/ssl.py", line 911, in read
    return self._sslobj.read(lne, buffer)
socket.timeout: The read operation timed out

It would seem that the ssl library is not properly making the connection. Note that this is not due to network errors, as the machines are on the same home network, can both ping the same hosts, and I have even run ofxclient concurrently on both.

Is there a known bug in the ssl library for python3 that is triggering this? Or is this an issue with ofxclient?

@eamsden
Copy link
Author

eamsden commented Dec 15, 2019

Update: it turns out that newer versions of ofxclient (>2.0.2 I think) send a user-agent header, and a comma-separated "accept" header, both of which appear to confuse Schwab's OFX servers.

I was able to run ofxclient-2.0.4 on the machine where I currently had things working with 2.0.2, and verify that it broke. Then, setting institution.client_args.accept = "application/x-ofx" and institution.client_args.user_agent = False for each of my Schwab accounts allowed me to download them with ofxclient-2.0.4.

@eamsden
Copy link
Author

eamsden commented Dec 15, 2019

It appears that this is addressed in #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant