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

SSL certificate verification problem. #151

Open
hbayindir opened this issue Oct 12, 2017 · 3 comments
Open

SSL certificate verification problem. #151

hbayindir opened this issue Oct 12, 2017 · 3 comments

Comments

@hbayindir
Copy link

I've probably found an edge case in nvPY's code. I'm currently stuck debugging it, so I need help.

  • The Problem: When I open nvPY, It fails to get the notes from the server.
  • The Reason: Because I get the exception <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)> in simplenote.py, line 57.
  • Why it's strange: Because when I try to connect to same URLs via my browser or the tool I've written to test urllib2, everything works great. I even transplanted the authenticate function from nvpy to the tool, and it's working correctly. The stranger thing is I have three computers which run the same distribution (Debian testing, all are up to date) with similar package lists and, other systems doesn't exhibit this problem.

All help and tips are greately appreciated. I'll fork and create a pull request for the fix, but I was unable to find a solution yet. All help is greatly appreciated!

@yuuki0xff
Copy link
Collaborator

humm... that's strange indeed.

would you tell me these results?

  • nvpy version.
  • environment variables on a python process. You would be easier to run strings /proc/${PYTHON_PID}/environ to get environment variables.
  • results of ssl.get_default_verify_paths()
  • results of openssl s_client -showcerts -connect simple-note.appspot.com:443 -servername simple-note.appspot.com </dev/null
  • occurrence frequency of that error.
  • do you use a proxy for the Internet access?

@hbayindir
Copy link
Author

Of course.

  • nvPY version: Freshly checked out of master, commit 127fdee.
  • I've attached two environment files. One is from nvpy, the other one is from python command. They are not different though.
  • Result of ssl.get_default_verify_paths(): DefaultVerifyPaths(cafile=None, capath='/usr/lib/ssl/certs', openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/usr/lib/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/usr/lib/ssl/certs')
  • I've also attached the result of openssl s_client -showcerts -connect simple-note.appspot.com:443 -servername simple-note.appspot.com </dev/null
  • This occurs every time. nvpy is unusable for me on this system.
  • No, my internet connection is transparent.

nvpy-environment.txt
openssl-command-result.txt
python-interpreter-environment.txt

@hbayindir
Copy link
Author

hbayindir commented Oct 13, 2017

I also have taken an environment snapshot from a system with a working nvPY, and I found the problem. My system locale on this system is tr_TR.UTF-8. Working system is en_US.UTF-8, and when I export en_US.UTF-8 to nvPY, it works as it should.

This is a notorious problem. In Turkish, we have two different I s. ı,I,i,İ. Unlike English and other languages which have the capitalization relation i <-> I, we have something more different: ı <-> I & i <-> İ. Probably code is doing a similar conversion somewhere, and things go south.

I think it should be fixed.

Obligatory Coding Horror story → What's wrong with Turkey?

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

2 participants