-
Notifications
You must be signed in to change notification settings - Fork 48
Needless requirement of tlsextradomain #203
Comments
Thanks for this issue. This is an interesting find. I never explicitly check for tlsextradomain or tlsextraip. The way we do it right now is:
I am not an expert on certificates, but shouldn't this work without tlsextradomain and tlsextraip? Nevertheless I like your idea with just hashing the cert as those immensly dense QR codes are not good. As I am neither an expert on certificates, nor have a lot of spare time right now, |
Yes, I solved the problem in #202 (however, that issue should still be open).
Maybe it's a bug/feature in some Android library? If feature, then I'm not sure what purpose it serves though. I don't see any security increase.
I hope not. I'd expect that the process is to completely disable certificate verification and then implement custom one. (I did something very similar on macOS a long time ago so it could work in principle, if the library is same.) I'm not an expert either, not even in development and this is not my top priority rn but I will try to help once I get to implementing the feature I need. Possibly within two months. |
@mrfelton |
Clients can then connect to the node with this certificate alone. If you try connecting to a node using a domain name or ip that is not set in Technically, you can bypass the need for these details to be in the cert or even the need to supply the cert to your tls client by telling your tls client to bypass tls validation and not reject self signed certificates, but it's a bad idea from a security perspective. |
@mrfelton why would it be a bad idea if you also check that the certificate is the one supplied by the QR code (or hash)? |
@Kixunil Please note that this does not change anything considering the tlsextradomain or tlsextraip. 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! |
That's really cool! Did you keep domain check intentionally or you didn't find out how to do it yet? |
I'm currently thinking deep about integrating Zap into my project and requiring Would you merge a PR removing the check if I figure out how to do it safely? |
@Kixunil We might merge a PR like that, if we reviewed it and have no concerns. |
I mean, I want to add support for generating QR codes. The biggest issue is that I'll try to look at it then. I will not dare to make a PR that would make it possible to do MITM or contain unreadable spaghetti, that you can be certain. :) |
This fixes connecting from Zap out of the box. This change was decided after having to do a similar change (externalip) for BTCPayServer anyway. It may be more future-proof as other similar software may require it. See also LN-Zap/zap-android#203
FYI, I needed to do a change similar to adding 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! |
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
lnd
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
The text was updated successfully, but these errors were encountered: