Commit graph

15 commits

Author SHA1 Message Date
Boris Nagaev
1629e3106a
session: fix mailbox TLS ALPN regression
Starting in grpc-go v1.67.0, clients and servers reject TLS handshakes when
ALPN is not negotiated. This changed the default value of
GRPC_ENFORCE_ALPN_ENABLED from false to true.

The default flip is in https://github.com/grpc/grpc-go/pull/7535

Our mailbox transport handshake can reach endpoints that currently do not
negotiate ALPN, so LNC session setup started failing and the lnc_auth flow
timed out, with malformed header/content-type errors showing up later on the
stream path.

This adds mailbox-specific TLS transport credentials that allow a missing
negotiated ALPN value for mailbox links. The mailbox server path and the
integration-test mailbox clients now use these credentials, so session
establishment works again.
2026-04-05 17:21:21 -05:00
Elle Mouton
87bef069e3
session: add session ID to grpc metadata via context
Add grpc interceptors that inject an LNC session's ID into the context
as gRPC metadata. By injecting it as such, it will be transported over
the wire in any outgoing gRPC calls.

This lets us be sure that any session call sent to the RPCMiddleware
interceptor in LND will continue to be grouped along with the
appropriate session ID. This gives LND a way to send the metadata we
include back to LiT meaning that we will later on be able to extract the
session ID again.
2025-05-15 06:15:10 +02:00
Elle Mouton
b82e01edf4
session: update session remote pub by session ID
It's a better pattern to refer to sessions in the same way consistently.
So we update the UpdateSessionRemotePubKey method to use a session ID as
a reference to the session instead of local pub key.
2025-03-04 17:39:03 +02:00
Elle Mouton
01c19c5172
session: add context to UpdateSessionRemotePubKey 2025-02-28 09:26:02 +02:00
Elle Mouton
d3a262600f
session: separate methods for creating vs updating a session 2023-08-25 16:02:13 +02:00
Elle Mouton
d5c26045f7
multi: add deadline for first connection of new LNC conn
In this commit, we add a deadline for the initial connection of an LNC
connection. So with this, the user is forced to use their pairing phrase
within a certain time frame. After this initial connection, future
connections are made with the second handshake version meaning that the
pairing phrase is rendered useless. By adding a time limit to the time
in which a user can use their pairing phrase, we reduce the risk created
by the users pairing phrase being leaked. The default time limit is set
to 10 minutes but can be customsed with the new `firstlncconndeadline`
flag.
2022-08-23 09:31:18 +02:00
Oliver Gugger
1444e7a180
multi: bump all dependencies to latest versions 2022-06-24 16:18:14 +02:00
Oliver Gugger
472d8f4602
multi: persist remote static key for handshakev2
This commit re-enables the second handshake for LNC.
2022-06-23 10:32:43 +02:00
Oliver Gugger
30d13ff7bb
Revert "multi: persist remote static key for handshakev2"
This reverts commit 31713c6e3d.
We will bump LNC to the latest version once the Terminal Web UI is ready
to persist the keys as well.
2022-04-20 14:42:26 +02:00
Elle Mouton
31713c6e3d
multi: persist remote static key for handshakev2
In this commit, we update the go mod to point to the version of LNC that
contains the logic for handshake version 2. This requires that we pass
in a call back that LNC can call to persist the remote static key once
it is received. This then needs to be provided each time we start up the
session again.
2022-04-19 09:49:08 +02:00
Oliver Gugger
46e9424bdf
Revert "multi: persist remote static key for handshakev2"
This reverts commit a2f1245020.
PR #342 was merged by accident before being fully reviewed and before
all dependent PRs were merged. Reverting.
2022-03-21 21:59:43 +01:00
Elle Mouton
a2f1245020
multi: persist remote static key for handshakev2
In this commit, we update the go mod to point to the version of LNC that
contains the logic for handshake version 2. This requires that we pass
in a call back that LNC can call to persist the remote static key once
it is received. This then needs to be provided each time we start up the
session again.
2022-03-21 14:18:40 +02:00
Elle Mouton
511be4fab9
session: add 2 min mailbox ping
Ensure that the mailbox grpc connection sends a ping every 2 mins to
ensure that the connection remains open.
2022-02-08 12:14:54 +02:00
Elle Mouton
259ad262b1 multi: add quit channel to mailboxSession
Add a quit channel to mailboxSession that will be closed on session
close. This is also returned from the StartSession function so that, in
a future commit, the channel can be listened on.
2022-01-17 17:13:58 +02:00
Oliver Gugger
f6568ab8e8
session: add session package 2021-11-24 13:44:25 -05:00