-
Notifications
You must be signed in to change notification settings - Fork 2k
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
gcoap_forward_proxy: CoAPS support #18107
base: master
Are you sure you want to change the base?
gcoap_forward_proxy: CoAPS support #18107
Conversation
Ok, I found now some hints on why this is not working:
|
So the idea is that a cllient would connect to the proxy via CoAP and the proxy would forward the connection via CoAPs to the server that it proxies for? That is exactly what we need 😃 |
The main idea is to have a CoAPS connection at both ends, but yes, in theory it should also work that you have a (unsecure) CoAP connection at one end and a secure CoAPS connection at the other. |
Maybe the problem above might not be an issue for this use case, but until it is resolved, this can't be merged of course. |
I'm afraid I figured out why this does not work: In That means the event handler will never¹ be executed as [1] it will be executed after the timeout, but then it's too late |
Yes, that exactly the conclusion I came to in July according to my comment. |
def4718
to
78154e3
Compare
@mariemC want to give this a try? |
Adoptions to current master
562f347
to
8181e26
Compare
Just noticed that I forgot about the new dependency to |
} | ||
memcpy(&remote->addr.ipv6[0], &addr.u8[0], sizeof(addr.u8)); | ||
|
||
if (urip->port != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you removed this by accident. Only when no port is specified make and assumption based on the scheme.
@@ -419,11 +424,13 @@ static int _gcoap_forward_proxy_via_coap(coap_pkt_t *client_pkt, | |||
client_ep_t *client_ep, | |||
uri_parser_result_t *urip) | |||
{ | |||
sock_udp_ep_t origin_server_ep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server endpoint is now stored in client_ep_t::server_ep
, so it can be forwarded to the proxy thread.
We need to add DTLS capability to the gcoap example client, don`t we? |
|
Contribution description
Allows to deploy the forward proxy using CoAPS / proxying a CoAPS connection.
Testing procedure
Still needs some work, currently, the proxy reports a Bad Option error, when used with CoAPS...
Issues/PRs references
None