-
Notifications
You must be signed in to change notification settings - Fork 422
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
Installing libcoap on ubuntu comes down to difficulties #1154
Comments
It would really help if when raising a new issue you had filled in the bug report information so that we can see what is actually failing. The output from stage 2 and stage 3 would be very helpful here. |
@salmeghlef It would be good to get to the bottom of what is going wrong here for you. In general there is not an issue here as several of the GitHub workflow actions done for every code push to the libcoap repository follow the same steps using Ubuntu and code is built with no issues. Please provide the requested information so we can help you. |
I came over the issue. When running Answering this inquiry will result in closing this issue. |
Firstly, when running
|
Many thanks John. Now, kindly, tell what is the best PSK facility (GnuTLS for instance) to be installed in order to enable DTLS. You may answer with terminal commands directly, then I will run |
Any of the 4 supported TLS libraries are fine to use for DTLS (see libcoap setup). The respective library needs to be installed on Ubuntu before |
I've done everything and enabling tinydtls, found an issue when running
|
Have you read BUILDING? Response to un-edited comment above. |
https://github.com/smartuni/examples/wiki/libcoap was written 7 years ago. A lot has changed since then with client.c being renamed and coap_list.c no longer used (as documented in the header lines of that file). |
I compiled everything and example folder contains the executable files for ./coap-client-tinydtls: error: '/home/kali/libcoap/ex/.libs/coap-client-tinydtls' does not exist when running without back slash coap-server: error while loading shared libraries: libcoap-3-tinydtls.so.3: cannot open shared object file: No such file or directory |
I spent much of time to resolve the issue above, but no to avail. Kindly, help with this final touch for this issue. |
I am not expecting
Looks like you did not do a clean |
I follow your advice to restart cloning the project again, doing these steps: ./make =====> gives the following error: (do I have to build the tinydtls inside libcoap independently) src/coap_tinydtls.c: In function 'coap_dtls_startup': |
As per #1154 (comment) I refer you again to BUILDING where it says
You either need to do this, or separately (build and) install the tinydtls library. |
I did these steps, the same error !!!! |
As your build does not complain about unable to access There is a I would expect your configuration summary to look something like (which works fine on my Ubuntu system)
|
Indeed, my system is Kali-linux based Debian, not Ubuntu-based. Is this going to affect the process? |
I am not familiar with Kali Linux. Does |
There is no (significant) difference between (plain) Debian and Ubuntu regarding the libcoap build. |
libcoap Configuration Summary: |
Ok, you are finding an old installed version of TinyDTLS which does not include code added in Oct 2019. |
when running: it gives the permanent error: configure: error: ==> Option '--enable-dtls' is set but none of the needed cryptography libraries GnuTLS, OpenSSL, Mbed TLS or TinyDTLS could be found! It is not working. Hope you can provide the updated version of tinydtls that fit for your project. Thank you |
|
For your edited update, --with-submodule-update is not the correct option and not recognised by ./configure. It is —with-submodule-tinydtls |
Note that this requires $ ./configure --disable-documentation --disable-shared --enable-dtls --with-submodule-tinydtls --with-tinydtls
...
libcoap Configuration Summary:
libcoap package version : "4.3.1"
libcoap package source : "v4.3.1-204-ge55ecc9"
libcoap library version : "3.0.0"
libcoap API version : "3"
libcoap DTLS lib extn : "-tinydtls"
host system : "x86_64-pc-linux-gnu"
build with server support : "yes"
build with client support : "yes"
build with IPv4 support : "yes"
build with IPv6 support : "yes"
build with Unix socket support : "yes"
build with TCP support : "yes"
build DTLS support : "yes"
--> TinyDTLS around : "yes" (submodule)
TinyDTLS_CFLAGS : "-I $(top_srcdir)/ext -I $(top_srcdir)/ext/tinydtls"
TinyDTLS_LIBS : "-L$(top_builddir)/ext/tinydtls -l:libtinydtls.a"
add default names : "yes"
build Observe Persist : "yes"
build using epoll : "yes"
enable small stack size : "no"
enable separate responses : "yes"
enable OSCORE support : "yes"
enable Q-Block support : "yes"
enable max logging level : "none"
build doxygen pages : "no"
build man pages : "no"
build unit test binary : "no"
build examples : "yes"
install examples source : "yes"
build with gcov support : "no"
build shared library : "no"
build static library : "yes"
$ make -j
...
$ examples/coap-client-tinydtls -v
examples/coap-client-tinydtls: option requires an argument -- 'v'
coap-client-tinydtls v4.3.1 -- a small CoAP implementation
Copyright (C) 2010-2023 Olaf Bergmann <bergmann@tzi.org> and others
Build: v4.3.1-204-ge55ecc9
TLS Library: TinyDTLS - runtime 0.8.6, libcoap built for 0.8.6
(DTLS and no TLS support; PSK, no PKI, no PKCS11, and RPK support)
(Have OSCORE)
(No WebSockets)
... |
libcoap Configuration Summary: However, when running $make .. it gives this error: warning: Changing CLASS_GRAPH option to TEXT because obsolete option CLASS_DIAGRAM was found and set to NO. |
This is an issue with the TinyDTLS code which your version of Kali-Linux has picked up. A PR has been raised for that - see eclipse-tinydtls/tinydtls#200. I suggest you make the following change to the TinyDTLS code in the interim.
|
I am not aware where to find the interim for TinyDTLS nor I am a software developer. Kindly, elaborate in short steps, for instance: This way can end up this issue. Thank you for your consideration |
Open terminal
|
I followed the steps and the code is the same for the one you provided. Unfortunately, an error is appearing. Anyway, I have installed ubuntu 22.04 as VM. It is working just fine now. Thanks a lot for you cooperation. To end up this issue, kindly, refer me to how to create PERMANENT interface in ubuntu. Always missing the created interfaces even adding them in /etc/network/.... after rebooting the system. |
Good that things are now working. It would have been useful to have had the next stage build error. This forum is specifically about libcoap issues / requests, and your Ubuntu network interface question need to be asked on another forum - sorry. |
Okay Olaf. Kindly see this issue: The same for coap instead of coaps. |
3 things here, could be more depending on your network interface definitions. You should not be using
There is no default Pre-Shared Key (PSK) definitions - you need to define them using the appropriate options if you want to use DTLS using the TinyDTLS library. Separately, you may want to use the |
I executed this line and the results showed:
Kindly, tell how to define the PSK since DTLS is not enabled as the message above. |
It is telling you to use one of the -k, -c, or -M options. |
It is working fine. Now, kindly tell me what is the best command to read the time from the server. For instance, I tried |
Please look at your error message, and then look at the documentation to define what you have not defined for PSK. Once things are working, you may want to stop using the verbose |
Do I have to define the secret key in |
Yes, both client and server need to share the same key, which is done by an out of band method. Hence |
Thanks Olaf. I think we are putting the final touch to launch ./coap-server-tinydtls and coap-client-tinydtls when running: J``` Kindly, help to fix this bug.
|
This is not a bug, but there is no server responding to the client's requests - the logs are reporting that after 4 attempts to talk to the server, the client is giving up. This could be for a multitude of reasons, which could be the server is listening on the wrong IP address or port, the client it trying to talk to the wrong IP address, or there is a firewall rule dropping the request (or the servers response). I am puzzled by
It is as if you have more than 6 interfaces defined and enabled on the VM instance or host that you are running ./coap-client-tinydtls on - is this correct? Why so many interfaces? |
That is totally true. I created 6 interfaces to test some attacks from different clients (multicast attack). I dedicated the interface 192.168.1.1 to run the coap-server-tinydtls. The others are for coap-client-tinydtls to test the coherent security for DTLS. By the way, if I want to access global coap-servers such as californium by Achim. How to know the pre-shared key (PSK) ?? Do I have to contact the coap-server owner to know the secrets ??? |
For anyone hosting a CoAP server, you will need to ask them what PSK (and Identity) to use. In this case it is |
Dear Olaf , I have created only three interfaces (tap1 192.168.1.1, tap2 and tap3 192.168.1.3) I am running the coap-server on tap1 as follows: I am following the documentation to write the commands, but it it is not working. kindly help .. |
I suspect that you have an underlying Linux networking issue with your tap interfaces and how they communicate (i.e forward / route packets). If the client / server work with regular network interfaces (can even be a single network interface), then this is not a libcoap issue. That said,
surprises me as I would expect the endpoint addresses to be
if you are using the unchanged examples/coap-server.c as the source for your server application. |
Thanks Olaf, it is working fine now after checking your suspicion by enabling the ip v4 route however, when using it says, WARN PSK is not defined Cannot create client session Kindly, guide me how to define the PSK since I tried to edit Hence, 192.168.1.1 is my |
You are not using the IPSEC protocol here. So I suspect you need to include the |
Thanks a lot Olaf. It is working now for The last inquiry is: if I am running
As it looks here, DTLS is working on port 5684! |
In a similar manner, the |
Thanks Olaf. I think it is time to close this issue. Your support is tremendously appreciated. |
Hi guys,
I have used this project to do some experiments and I published two papers acknowledging this project. I was install this project with simple steps:
1- ./autogen.sh
2- ./configure
3- make
4- make install
However, after updating the project to new version, step 3 doesn't work,,, please guide ,,
Thank you
Sultan
The text was updated successfully, but these errors were encountered: