fix(ssl): use reserved IP for connection failure test
Use 198.18.0.1 (IANA reserved benchmark address) instead of 127.0.0.1:9999 to ensure reliable connection failure in tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
edc135ae5f
commit
5090bd4cbe
@ -628,8 +628,8 @@ func TestOCSPManager_SendOCSPRequest_Error(t *testing.T) {
|
|||||||
t.Error("Expected error for invalid URL")
|
t.Error("Expected error for invalid URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 测试连接失败
|
// 测试连接失败 - 使用保留的不可达 IP 地址 (198.18.0.0/15 是 IANA 保留用于基准测试的地址块)
|
||||||
_, err = mgr.sendOCSPRequest("http://127.0.0.1:9999/ocsp", []byte("test"))
|
_, err = mgr.sendOCSPRequest("http://198.18.0.1:9999/ocsp", []byte("test"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Error("Expected error for connection failure")
|
t.Error("Expected error for connection failure")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user