Refactoring
Refactored Protocol.Name -> Protocol.Type; added Encapsulation field Refactored TLS parsing; added support for ALPN
This commit is contained in:
@@ -36,7 +36,7 @@ func TestDetectPostgreSQLClient(t *testing.T) {
|
||||
Direction: Client,
|
||||
Data: pgClientStartup,
|
||||
DstPort: 5432,
|
||||
WantProto: ProtocolPostgreSQL,
|
||||
WantType: TypePostgreSQL,
|
||||
WantConfidence: .85,
|
||||
},
|
||||
{
|
||||
@@ -77,7 +77,7 @@ func TestDetectPostgreSQLServer(t *testing.T) {
|
||||
Direction: Server,
|
||||
Data: pgServerAuthOK,
|
||||
DstPort: 5432,
|
||||
WantProto: ProtocolPostgreSQL,
|
||||
WantType: TypePostgreSQL,
|
||||
WantConfidence: .65,
|
||||
},
|
||||
{
|
||||
@@ -95,9 +95,9 @@ func TestDetectPostgreSQLServer(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
return
|
||||
}
|
||||
t.Logf("detected %s version %s confidence %g%%", p.Name, p.Version, c*100)
|
||||
if p.Name != ProtocolPostgreSQL {
|
||||
t.Fatalf("expected postgres protocol, got %s", p.Name)
|
||||
t.Logf("detected %s version %s confidence %g%%", p.Type, p.Version, c*100)
|
||||
if p.Type != TypePostgreSQL {
|
||||
t.Fatalf("expected postgres protocol, got %s", p.Type)
|
||||
return
|
||||
}
|
||||
})
|
||||
@@ -108,9 +108,9 @@ func TestDetectPostgreSQLServer(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
return
|
||||
}
|
||||
t.Logf("detected %s version %s confidence %g%%", p.Name, p.Version, c*100)
|
||||
if p.Name != ProtocolPostgreSQL {
|
||||
t.Fatalf("expected postgres protocol, got %s", p.Name)
|
||||
t.Logf("detected %s version %s confidence %g%%", p.Type, p.Version, c*100)
|
||||
if p.Type != TypePostgreSQL {
|
||||
t.Fatalf("expected postgres protocol, got %s", p.Type)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user