emqx-coap icon indicating copy to clipboard operation
emqx-coap copied to clipboard

can't connect to emqx by DTLS

Open yunanxing opened this issue 5 years ago • 8 comments

Environment

  • OS: CentOS7
  • Erlang/OTP: NA
  • EMQ: v3.2.0

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!

yunanxing avatar Aug 09 '19 07:08 yunanxing

Any progress in resolving the bug?

frizner avatar Apr 03 '20 22:04 frizner

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.

qingchuwudi avatar Apr 15 '20 08:04 qingchuwudi

@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.

frizner avatar Apr 15 '20 15:04 frizner

@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?

terry-xiaoyu avatar Apr 16 '20 01:04 terry-xiaoyu

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 avatar Apr 06 '21 02:04 xianchaoZou

@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..

xianchaoZou avatar Apr 06 '21 02:04 xianchaoZou

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

yunanxing avatar Apr 06 '21 03:04 yunanxing

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 : [email protected]

xianchaoZou avatar Apr 06 '21 06:04 xianchaoZou