absmach / magistrala

Industrial IoT Messaging and Device Management Platform
https://www.abstractmachines.fr/magistrala.html
Apache License 2.0
2.43k stars 666 forks source link

Bug: CoAP with TLS doesn't Support UDP #1963

Open rodneyosodo opened 6 months ago

rodneyosodo commented 6 months ago

What were you trying to achieve?

Test coap server with TLS i.e providing certificate and key

What are the expected results?

To work with TLS

What are the received results?

cannot create new tls listener: cannot create new net tcp listener: unknown network udp

Steps To Reproduce

Provide certificate and key when starting coap server

In what environment did you encounter the issue?

main branch

Additional information you deem important

https://github.com/absmach/magistrala/blob/ff12f7fca35534a2b012ed10d320b58ed13eb46a/internal/server/coap/coap.go#L58C1-L60C6

go func() {
    errCh <- gocoap.ListenAndServeTCPTLS("udp", s.Address, tlsConfig, s.handler)
}()

This works when the network is TCP and not UDP

drasko commented 5 months ago

@dborovcanin @1998-felix can someone please take a look at this issue

felixgateru commented 3 months ago

DTLS termination will be carried out on mproxy and is handled by https://github.com/absmach/mproxy/pull/60

dborovcanin commented 2 months ago

Blocked by https://github.com/absmach/mproxy/pull/60.