mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 02:59:01 +08:00
Add failed TLS host validation
This commit is contained in:
parent
436852d077
commit
6b3d9d9baf
@ -833,6 +833,15 @@ static void test_http_client(void) {
|
||||
mg_tls_init(c, &opts);
|
||||
for (i = 0; i < 500 && ok <= 0; i++) mg_mgr_poll(&mgr, 10);
|
||||
ASSERT(ok == 200);
|
||||
|
||||
// Test failed host validation
|
||||
ok = 0;
|
||||
opts.srvname = mg_str("dummy");
|
||||
c = mg_http_connect(&mgr, url, f3, &ok);
|
||||
ASSERT(c != NULL);
|
||||
mg_tls_init(c, &opts);
|
||||
for (i = 0; i < 500 && ok <= 0; i++) mg_mgr_poll(&mgr, 10);
|
||||
ASSERT(ok == 777);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user