emqx / emqx-coap

EMQX CoAP Gateway
https://www.emqx.com
Apache License 2.0
61 stars 34 forks source link

can't connect to emqx by DTLS #126

Open yunanxing opened 5 years ago

yunanxing commented 5 years ago

Environment

Description I can use libcoap and californium client to connect EMQX_COAP By udp. And terminal was online in EMQX Dashboard, I can publish subscribe topic. But when i use DTLS, I can't get any message from log without any error , but i can't find my terminal in EMQ Dashboard. I can communicate with californium demo server using the same client by DTLS. I would like to know how to connect to EMQX using DTLS, thanks!

frizner commented 4 years ago

Any progress in resolving the bug?

qingchuwudi commented 4 years ago

Is there any messages when using libcoap to send to emqx or recv from emqx?

For example:

coap-client -m put -e 1234 "coaps://127.0.0.1/mqtt/topic1?c=client1&u=tom&p=secret"
Apr 15 16:11:54.659 WARN do_gnutls_handshake: session establish returned -15: 'An unexpected TLS packet was received.'
Apr 15 16:11:55.664 WARN do_gnutls_handshake: session establish returned -10: 'The specified session has been invalidated for some reason.'

If so, you should use ./configure --enable-documentation=no --enable-tests=no --with-openssl instead of ./configure --enable-documentation=no --enable-tests=no. It is the diffrence between diffrent ssl libraries which leads to this error.

frizner commented 4 years ago

@qingchuwudi : Thank you for the response.

I rebuilt coaplib but still have the same issue with no any notification from a client or a server.

terry-xiaoyu commented 4 years ago

@frizner We tested using emqx with 4.0.5 and libcoap with develop branch. It's working as expected.

Could you have a try? And if the same problem repeats, could you please post the Wireshark capture file of the DTLS handshake procedure?

xianchaoZou commented 3 years ago

Is there any progress on this issue? I'm also paying attention to this problem, because I've never succeeded in creating coups to connect emqx with the California framework. Can you share the Certificate creation command used in the test..

xianchaoZou commented 3 years ago

@frizner We tested using emqx with 4.0.5 and libcoap with develop branch. It's working as expected.

Could you have a try? And if the same problem repeats, could you please post the Wireshark capture file of the DTLS handshake procedure?

Can you share the Certificate creation command used in the test..

yunanxing commented 3 years ago

Is there any progress on this issue? I'm also paying attention to this problem, because I've never succeeded in creating coups to connect emqx with the California framework. Can you share the Certificate creation command used in the test..

I use openssl to create certificate, and there is a tool to do it, I can send it to you by email, please left you email

xianchaoZou commented 3 years ago

Is there any progress on this issue? I'm also paying attention to this problem, because I've never succeeded in creating coups to connect emqx with the California framework. Can you share the Certificate creation command used in the test..

I use openssl to create certificate, and there is a tool to do it, I can send it to you by email, please left you email

Thank you so much. my email : zou_xian_chao@163.com