|
|
@@ -201,6 +201,7 @@ func TestTLSOSSH(t *testing.T) {
|
|
|
runServer(t,
|
|
|
&runServerConfig{
|
|
|
tunnelProtocol: "TLS-OSSH",
|
|
|
+ passthrough: true,
|
|
|
enableSSHAPIRequests: true,
|
|
|
requireAuthorization: true,
|
|
|
doTunneledWebRequest: true,
|
|
|
@@ -681,11 +682,15 @@ func runServer(t *testing.T, runConfig *runServerConfig) {
|
|
|
}
|
|
|
|
|
|
var tunnelProtocolPassthroughAddresses map[string]string
|
|
|
+ var passthroughAddress *string
|
|
|
|
|
|
if runConfig.passthrough {
|
|
|
+ passthroughAddress = new(string)
|
|
|
+ *passthroughAddress = "x.x.x.x:x"
|
|
|
+
|
|
|
tunnelProtocolPassthroughAddresses = map[string]string{
|
|
|
// Tests do not trigger passthrough so set invalid IP and port.
|
|
|
- runConfig.tunnelProtocol: "x.x.x.x:x",
|
|
|
+ runConfig.tunnelProtocol: *passthroughAddress,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1467,6 +1472,7 @@ func runServer(t *testing.T, runConfig *runServerConfig) {
|
|
|
expectUDPDataTransfer,
|
|
|
expectQUICVersion,
|
|
|
expectDestinationBytesFields,
|
|
|
+ passthroughAddress,
|
|
|
logFields)
|
|
|
if err != nil {
|
|
|
t.Fatalf("invalid server tunnel log fields: %s", err)
|
|
|
@@ -1604,6 +1610,7 @@ func checkExpectedServerTunnelLogFields(
|
|
|
expectUDPDataTransfer bool,
|
|
|
expectQUICVersion string,
|
|
|
expectDestinationBytesFields bool,
|
|
|
+ expectPassthroughAddress *string,
|
|
|
fields map[string]interface{}) error {
|
|
|
|
|
|
// Limitations:
|
|
|
@@ -2063,6 +2070,16 @@ func checkExpectedServerTunnelLogFields(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if expectPassthroughAddress != nil {
|
|
|
+ name := "passthrough_address"
|
|
|
+ if fields[name] == nil {
|
|
|
+ return fmt.Errorf("missing expected field '%s'", name)
|
|
|
+ }
|
|
|
+ if fields[name] != *expectPassthroughAddress {
|
|
|
+ return fmt.Errorf("unexpected field value %s: %v != %v", name, fields[name], *expectPassthroughAddress)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if runConfig.doLogHostProvider {
|
|
|
name := "provider"
|
|
|
if fields[name] == nil {
|