3

I have scripts relying on the python "Requests" library. Two different scripts relying on the same lib all throw the same error (Tweepy crashes because of it, as does a simple HTTP GET):

xtras/python/requests/api.py", line 44, in request       return
session.request(method=method, url=url, **kwargs)                     
File
"/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/requests/sessions.py",
line 461, in request                                                  
resp = self.send(prep, **send_kwargs)              File
"/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/requests/sessions.py",
line 567, in send    r = adapter.send(request, **kwargs)              
File
"/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/requests/adapters.py",
line 400, in send    raise SSLError(e, request=request)              
requests.exceptions.SSLError: [Errno 1] _ssl.c:480:
error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message
digest algorithm

This has only started happening recently (it worked fine before). The script is running on an Android phone using SL4A.

Nilesh
  • 20,521
  • 16
  • 92
  • 148
user2372996
  • 73
  • 1
  • 2
  • 8
  • Think it's the version of OpenSSL linked with python doesn't like the hashing algorithm used in the certificate. I think you need to link python to a more recent version of OpenSSL – GP89 Nov 10 '14 at 10:41

1 Answers1

0

I had the exact same issue. As far as I can tell, this problem is caused by the version/build of Python installed on your phone. I assume you are using the Python 2 apk from the Py4a project.

To solve the problem, you can install the Python 3 apk which seems to better support SSL, but if you do so, you will need to port your scripts from Python 2 to Python 3.

Luc Touraille
  • 79,925
  • 15
  • 92
  • 137