Set tunneling options for (not) using community nodes

This commit is contained in:
Daniel
2022-08-30 13:27:18 +02:00
parent c459b0f4af
commit 770ce61b84
4 changed files with 34 additions and 14 deletions

View File

@@ -114,6 +114,11 @@ func checkTunneling(ctx context.Context, conn *network.Connection, pkt packet.Pa
RoutingProfile: layeredProfile.SPNRoutingAlgorithm(),
}
// Add required verified owners if community nodes should not be used.
if !useCommunityNodes() {
conn.TunnelOpts.RequireVerifiedOwners = captain.NonCommunityVerifiedOwners
}
// If we have any exit hub policies, we need to raise the routing algorithm at least to single-hop.
if conn.TunnelOpts.RoutingProfile == navigator.RoutingProfileHomeID &&
conn.TunnelOpts.HubPoliciesAreSet() {