berty / berty

Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network
https://berty.tech
Other
7.55k stars 382 forks source link

Unable to send messages from Go functions using insecure connection to Android #4403

Closed jalavosus closed 8 months ago

jalavosus commented 2 years ago

Is there an existing issue for this?

Berty product

Code package

Berty product version

v2.432.0

OS

macOS

OS version

11.6.7

Device

No response

Steps to reproduce

  1. Start berty daemon with -node.service-insecure set to true: berty daemon -no-qr -node.service-insecure=true
  2. Start a bot with the option bertybot.WithInsecureMessengerGRPCAddr("127.0.0.1:9091") (can provide repo if needed)
  3. Use Berty Android app to add a contact using the resultant QR code/link created for that bot
  4. Observe logs (see "Current Behavior")

Current behavior

2022-09-04T00:29:46.531-0400    ERROR   bty.pt.req-mngr     bertyprotocol/contact_request_manager.go:177    unable to handle incoming contact request   {"error": "handshake failed: ErrHandshakeRequesterHello(#1104): ErrHandshakePeerEphemeralKeyRecv(#1101): ErrStreamRead(#105): EOF"}

2022-09-04T00:29:46.796-0400    ERROR   bty.odb-dc          directchannel/channel.go:61 invalid buffer length   {"error": "short buffer"}

2022-09-04T00:29:46.816-0400    ERROR   bty.odb             baseorbitdb/orbitdb.go:998  unable to unmarshal message payload {"error": "unable to unmarshal payload `7b2261646472657373223a222f6f7262697464622f626166797265696262627278347a636b67683270633264676d74336c72736d34753472647a696b643469726763707479767972726d32666a366d652f373635626634393965633837313166376336613536653938376136656664663636343165643237646630313534326164303362366539623938616264343733325f62657274795f67726f75705f6d65737361676573222c226865616473223a5b5d7d`: proto: illegal wireType 7"}

I assume this issue stems from my bot code using an insecure connection, while the Android app is using a secure connection. That being said, there is next to no documentation (at least, that I'm able to find) for using the Android app with a local daemon, nor for interacting with a local (development) bot in general.

What should I be doing here? I don't think this is a bug so much as my not using berty correctly for this, so I'm open to any and all suggestions/"you're doing it wrong and it's super easy how did you miss this"/whatevers.

I'll also note that I'm using the testbot code as the basis for creating a "bot" instance and connecting to my local daemon.

Expected behavior

No response

Other

No response

jefft0 commented 9 months ago

Hello @jalavosus . Are you still working on your application? Is this still an issue for you?

jalavosus commented 9 months ago

@jefft0 Ah, wow, this is over a year old. Since I hadn't gotten a response, I stopped bothering to make an attempt at getting this to work.

jefft0 commented 9 months ago

Sorry for the delay. If you are not working on this project, shall we close this issue?

jefft0 commented 8 months ago

Closing as the poster's project is not being worked on.