mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
parent
e1ea58b7c4
commit
8561f42786
1 changed files with 6 additions and 4 deletions
|
@ -298,10 +298,12 @@ func TestSetupParseWithCurves(t *testing.T) {
|
||||||
t.Errorf("Expected 3 curves, got %v", len(cfg.CurvePreferences))
|
t.Errorf("Expected 3 curves, got %v", len(cfg.CurvePreferences))
|
||||||
}
|
}
|
||||||
|
|
||||||
expectedCurveOrder := []tls.CurveID{tls.CurveP256, tls.CurveP384, tls.CurveP521}
|
expectedCurves := []tls.CurveID{tls.CurveP256, tls.CurveP384, tls.CurveP521}
|
||||||
for i := range cfg.CurvePreferences {
|
|
||||||
if cfg.CurvePreferences[i] != expectedCurveOrder[i] {
|
// Ensure ordering is correct
|
||||||
t.Errorf("Expected %v as curve, got %v", expectedCurveOrder[i], cfg.CurvePreferences[i])
|
for i, actual := range cfg.CurvePreferences {
|
||||||
|
if actual != expectedCurves[i] {
|
||||||
|
t.Errorf("Expected curve in position %d to be %v, got %v", i, expectedCurves[i], actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue