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:
xfy 2026-05-09 08:20:10 +08:00
parent edc135ae5f
commit 5090bd4cbe

View File

@ -628,8 +628,8 @@ func TestOCSPManager_SendOCSPRequest_Error(t *testing.T) {
t.Error("Expected error for invalid URL")
}
// 测试连接失败
_, err = mgr.sendOCSPRequest("http://127.0.0.1:9999/ocsp", []byte("test"))
// 测试连接失败 - 使用保留的不可达 IP 地址 (198.18.0.0/15 是 IANA 保留用于基准测试的地址块)
_, err = mgr.sendOCSPRequest("http://198.18.0.1:9999/ocsp", []byte("test"))
if err == nil {
t.Error("Expected error for connection failure")
}