question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Needless requirement of tlsextradomain

See original GitHub issue

Description

tlsextradomain shouldn’t be needed if the certificate is explicitly pinned. The wallet already checks the certificate matches, so domain doesn’t provide any value beside annoyance.

Expected Behavior

The wallet checks that the certificate provided in URI matches the one sent by the server and accepts it without other conditions.

Actual Behavior

Zap rejects certificates without tlsextradomain despite it knowing that the certificate matches.

Possible Fix

Remove unnecessary domain check, check certificate equality only. Even better, instead of putting the whole certificate into the URI (and QR code), it could just use SHA256, which would be significantly shorter.

Steps to Reproduce

  1. configure and launch lnd instance without tlsextradomian and tlsextraip
  2. generate QR code and use it for connecting
  3. see error
  4. set tlsextradomain
  5. delete tls.cert and tls.key
  6. restart lnd
  7. re-create QR code
  8. connect and see it working

Context

I was trying to connect to a lnd node. I will also want to provide lndconnect QR code in the future using fairly complex process that may not know the domain name at the time of setting up lnd. This would lead to terrible complexity.

Your Environment

  • Zap version: 0.3.0-beta
  • Android version: 10
  • Device: Google Pixel 3
  • LND Version: 0.10.0-beta

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelWuenschcommented, Jun 19, 2020

@Kixunil I couldn’t get the idea out of my head and actually made a test implementation of the certificate hashing and new trusting mechanism yesterday. It was a lot easier than i thought. https://github.com/michaelWuensch/zap-android/commit/96ebf6cc39247a2661507f650393605093fb0000

Please note that this does not change anything considering the tlsextradomain or tlsextraip. We are still using the certificate to create a secure connection and therefore are bound to those values. The only thing that has changed is the way we determine if we should trust that certificate. It allows us to now only transmit a certificate hash in the lndconnect string which makes the QR-Code a lot less dense.

To make this happen though it has to be implemented for Desktop and iOS as well and the actual lndconnect has to be updated.

Thanks for your input!

0reactions
Kixunilcommented, Aug 8, 2020

FYI, I needed to do a change similar to adding tlsextradomain for BTCPayServer, so I decided to support tlsextradomain too. I figured the setting can be used multiple times, so thankfully there’s no conflict with admin configuration.

This means I’m de-prioritizing my PR to remove the requirement. I might still do it at some point, but probably not anytime soon. Thanks for all your support so far anyway!

Read more comments on GitHub >

github_iconTop Results From Across the Web

LND Configuration
Using LND's tlsextradomain setting you can add additional domain names to the TLS certificate. This will allow connecting to LND using a domain...
Read more >
zap-android
Needless requirement of tlsextradomain. Kixunil. Kixunil CLOSED · Updated 2 years ago · Too generic error message makes it impossible to solve connection ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found