Skip to content

Conversation

@felixgateru
Copy link
Contributor

@felixgateru felixgateru commented Sep 15, 2023

What does this do?

Add DTLS support to CoAP messaging

Which issue(s) does this PR fix/relate to?

None

List any changes that modify/break current functionality

Refactor: Updated the nginx reverse proxy with CoAP stream.
Refactor: Add internal server configuration for DTLS support.

Have you included tests for your changes?

No

Did you document any new/modified functionality?

No

Notes

To be merged after https://github.com/mainflux/mainflux/pull/1918

@felixgateru felixgateru changed the title NOISSUE - description NOISSUE - Add DTLS support to CoAP messaging Sep 15, 2023
handler mux.HandlerFunc
}

var enableDTLS = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use env var to pass this

handler mux.HandlerFunc
}

var enableDTLS = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use env var to pass this

Certificates: []tls.Certificate{certificate},
}

go func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be the default case in line 78

@felixgateru felixgateru force-pushed the coap_dtls branch 2 times, most recently from fdf4654 to 908e596 Compare October 18, 2023 10:10
handler mux.HandlerFunc
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


go func() {
errCh <- gocoap.ListenAndServeTCPTLS("udp", s.Address, tlsConfig, s.handler)
errCh <- gocoap.ListenAndServeDTLS("udp", s.Address, dtlsConfig, s.handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is ListenTCP removed, we shoulld have all 3 options, no TLS, TLS and DTLS. Modify the config file and this

Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had two minor remarks. The rest is good. Please address those and remove draft, then we will merge.

}
}

# COAP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoAP

}
}

#COAP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoAP, and add space after the #

@felixgateru felixgateru marked this pull request as ready for review October 20, 2023 03:34
@felixgateru felixgateru requested a review from a team as a code owner October 20, 2023 03:34
}
}

#CoAP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a space after the # comment, I have already demanded this.

Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having two top-level stream directives is not allowed. Move CoAP server under the same stream as MQTT and always manually test PRs since this won't work due to multiple stream directives.


upstream coap_cluster {
server coap-adapter:${MF_COAP_ADAPTER_HTTP_PORT};
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line to the end of the file.

# SPDX-License-Identifier: Apache-2.0

upstream coap_cluster {
server coap-adapter:${MF_COAP_ADAPTER_HTTP_PORT};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just CoAP port, not CoAP HTTP port (HTTP is used only for healthcheck).

@felixgateru felixgateru force-pushed the coap_dtls branch 2 times, most recently from 4c6a6c4 to 0e4b393 Compare October 24, 2023 03:06
@arvindh123
Copy link
Contributor

Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
@dborovcanin
Copy link
Collaborator

This has been added as a feature to mGate and will be a feature of mProxu, so it is not needed here.

@dborovcanin dborovcanin closed this Dec 1, 2025
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.

5 participants