-
Notifications
You must be signed in to change notification settings - Fork 45
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
"DTLS_server_method" not found in libssl.1.0.0 #15
Comments
PyDTLS did not install OpenSSL (including the file libssl.1.0.0) on your machine. OpenSSL dll's are part of the PyDTLS installation tree on Windows only. Linux platforms usually provide a sufficiently recent version of OpenSSL, and this must be available before PyDTLS can run. It is possible that the OpenSSL version on your machine is older than 1.0.2. But you can't tell that from the shared object's file name. You may want to try to upgrade your OpenSSL version using your package manager. If that doesn't work, you could build OpenSSL yourself, and then put it into a place in the file system where the PyDTLS OpenSSL library loader will find it. |
But you are linking to libssl1.0.0 from /dtls/openssl.py as per above traceback from dtls itself. Openssl version is 1.0.2g in my Raspberry pi3 machine but libssl1.0.0 is shown whenever i install pyDtls. How to fix this? |
Make sure that the shared object libssl.so.1.0.0 that is used by your OpenSSL installation (which is version 1.0.2g, as you say) is that same as the one your system loader delivers when PyDTLS opens it (openssl.py in PyDTLS opens the shared object without path prefix). If your /usr/bin/openssl is statically linked, then install an OpenSSL version that uses shared objects instead. |
As per below code, does 'pyDtls' not link to 'else' part ? |
Yes, the 'else' portion is used on non-Windows platforms. libssl.so.1.0.0 refers to OpenSSL 1.0.2 wherever that version of OpenSSL is installed. As your output shows, the version of OpenSSL in /usr/bin is not dynamically linked against libssl.so and libcrypto.so. So there is nothing there that PyDTLS can use. You need a version of OpenSSL that is dynamically linked. It's also worth noting that since your executing flow proceeds up to the point of trying to import a particular symbol (DTLS_server_method), some version of the shared libraries must have been successfully opened. But the version of /usr/bin/openssl you show above is not using those shared libraries. So it looks like you've got more than one OpenSSL version installed on your system - one being the statically linked /usr/bin/openssl and then some shared libraries, perhaps of an older version, that PyDTLS ends up opening. |
Now, I understood. But I installed OpenSSL many times but it is not linking dynamically. I am sorry to ask this but do you know how to link it dynamically ? Any link to install openssl which links dynamically will be appreciated ? |
I can't answer your question because I know nothing about your platform. You may want to ask in some community forum how you can install a recent dynamically linked version of OpenSSL. And, as I mentioned before, if you can't find an answer to that question, then you can download the OpenSSL source distribution, and then follow the build and install instructions to create your own version. You'll probably want to uninstall the existing version(s) of OpenSSL from your machine before you do that to prevent confusion. |
I installed openSSL that includes shared lib, /usr/lib has now 'libssl.so.1.1' but still problem is same. Problem here I see is AttributeError: /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0: undefined symbol: DTLS_server_method (i.e. libssl.so.1.0.0 inside /arm-liunx* does not have DTLS server method) |
You installed the wrong OpenSSL series. OpenSSL currently has two active and supported series: 1.0.2 and 1.1.0. PyDTLS requires 1.0.2 (see also https://www.openssl.org/source/). And you also still have your old OpenSSL version installed in /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0. Previously I recommended that you uninstall your old version before experimenting with new versions. What is your plan for having your system's dynamic loader find the new and correct OpenSSL shared object version once you do manage to install that? |
Thanks for your comment. I am trying to install inside /usr/lib/arm-linux-gnueabhihf as my Raspberry pi is taking openssl lib from this path. I will try following first
Do I still need to put it inside /usr/bin/openssl |
Good starting point, but I think you need to pay attention to the following points:
|
Here's one solution - I use a Linux server which has a different version of openssl. Rather than install a different version system-wide, I created a local build of openssl 1.0.2g
Then before running python, set the LD_LIBRARY_PATH: |
Try this:
edit the dtls/openssl.py file inside this repo,
then run: if you get the error: IOError: [Errno 2] No such file or directory: 'README.rst'
then run the python setup.py install again... I will open a PR for this changes... |
I have installed "pip install Dtls" in my raspberry pi3.
Now the problem is:
Problem:
Note: Looks like, pyDTLS that installed libssl.1.0.0 which does not have "DTLS_server_method".
May be it is required to install libssl.1.0.2 from pyDtls itself. How to do this ?
I am getting following error while trying to use your DTLS method for my test_secure.py COAP method.
Traceback (most recent call last):
File "test_secure.py", line 23, in
from dtls.wrapper import wrap_server, wrap_client
File "/usr/local/lib/python2.7/dist-packages/dtls/init.py", line 63, in
from patch import do_patch
File "/usr/local/lib/python2.7/dist-packages/dtls/patch.py", line 44, in
from sslconnection import SSLConnection, PROTOCOL_DTLS, PROTOCOL_DTLSv1, PROTOCOL_DTLSv1_2
File "/usr/local/lib/python2.7/dist-packages/dtls/sslconnection.py", line 60, in
from x509 import _X509, decode_cert
File "/usr/local/lib/python2.7/dist-packages/dtls/x509.py", line 34, in
from openssl import *
File "/usr/local/lib/python2.7/dist-packages/dtls/openssl.py", line 811, in
((c_char_p, "ret"), (c_int, "nid")), True, None),
File "/usr/local/lib/python2.7/dist-packages/dtls/openssl.py", line 642, in
map(lambda x: _make_function(*x), (
File "/usr/local/lib/python2.7/dist-packages/dtls/openssl.py", line 562, in _make_function
for i in args[1:]))
AttributeError: /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0: undefined symbol: DTLS_server_method
The text was updated successfully, but these errors were encountered: