Skip to content

Add 'enable-ssl.patch' to Python2Recipe.patches #935

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

Closed
wants to merge 1 commit into from
Closed

Add 'enable-ssl.patch' to Python2Recipe.patches #935

wants to merge 1 commit into from

Conversation

PapaTutuWawa
Copy link

@PapaTutuWawa PapaTutuWawa commented Nov 20, 2016

This PR is supposed to fix the issue that ssl cannot be imported in python2
See issue #934

@inclement
Copy link
Member

inclement commented Nov 26, 2016

I was looking into this to understand it better, and I think this patch is maybe supposed to be unnecessary following https://github.com/kivy/python-for-android/pull/838/files , but I'm not really sure. I've never used openssl directly myself, so I'll try to test it just to be sure.

@PapaTutuWawa
Copy link
Author

Maybe this helps to reproduce it: If I try to import (python2) ssl or use a package that imports ssl, I always got the error that _ssl cannot be found (See #934, like in the original PR description).
But I'm not sure it it's a bug/erorr in p4a or just my incredible ability to break every piece of software I touch.

@brussee
Copy link
Contributor

brussee commented Nov 26, 2016

Wether you can use openssl directly is not changed by #838. Packages that link to openssl, as you can see in #838, do so dynamically. If you find a package that fails to import ssl you need to link it at compile time or use the 'enable-ssl.patch', I think.

@Fak3
Copy link
Contributor

Fak3 commented Nov 27, 2016

This is a possible fix for #850 I will try to check when i have time

@frankgould
Copy link

frankgould commented Dec 30, 2016

I tried this patch and got the same error (below) after the patch.

E/dalvikvm( 3869): dlopen("/data/app-lib/com.masterpics.slideshow-1/libpython2.7.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libssl1.0.2h.so" needed by "libpython2.7.so"; caused by load_library(linker.cpp:745): library "libssl1.0.2h.so" not found

Android 4.2.2 generates this error but 4.4.2 does not generate this error.

@frankgould
Copy link

Are there any suggestions to fix this problem? I'm still getting the same error and can't find a solution online.

@KeyWeeUsr
Copy link
Contributor

KeyWeeUsr commented Apr 14, 2017

@frankgould see this answer. Basically it means that 4.2 isn't able to load libs automatically, so we do it here instead. We should probably have a way how to include custom libs into that for loop too.

@frankgould
Copy link

Hi KeyWeeUsr, thanks for your quick response. I tried several different compiles with PythonUtil.java edited with the additional "load" code but these all errored out by not finding the names.
System.loadLibrary(openssl);
System.loadLibrary(pyopenssl);
System.loadLibrary(libssl);

So, I grep searched for libpythonXXX.so and found 5 copies of PythonUtil.java, some did not have the System.loadLibrary(lib), which I added and rebuilt. Now the error is "Cannot load library: find_library(linker.cpp:889): "/data/app-lib/com.masterpics.slideshow-1/libpython2.7.so" failed to load previously."

I wasn't sure if it is helpful but below are recipes I am using.
includes recipes (hostpython2, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, python2, numpy, sdl2, setuptools, six, android, opencv, pyjnius, pyopenssl, kivy), built for archs (armeabi-v7a)

My buildozer.spec requirements are:
requirements = kivy,openssl,pyopenssl,hostpython2,opencv,android

Thanks again for your help.

@frankgould
Copy link

I was able to solve this using the information from the following link:
#903

@Bakterija
Copy link
Contributor

Bakterija commented Jul 10, 2017

I just used this to enable ssl in gevent (python 2). Otherwise it complains about missing _ssl

@Zen-CODE
Copy link
Member

This change did not fix the issue 850 for me.

#850

@AndreMiras
Copy link
Member

This is rather old and conflicting with recent p4a refactoring, e.g. #1537
Feel free to open a new one if needed

@AndreMiras AndreMiras closed this Jan 10, 2019
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

Successfully merging this pull request may close these issues.

9 participants