mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-17 10:59:39 +00:00
* Add Tests for case sensitive hostname verfication * Modify check_host_name to perform case insensitive comparisons during ssl hostname validation --------- Co-authored-by: Tabor, Chris <chris.tabor@commscope.com>
This commit is contained in:
1 parent
c3fa06112b
commit
fbec2a3466
2 files changed
+45
-4
No files matched your search
@@ -8717,6 +8717,31 @@ TEST(SSLClientTest, WildcardHostNameMatch_Online) {
|
||||
ASSERT_EQ(StatusCode::OK_200, res->status);
|
||||
}
|
||||
|
||||
TEST(SSLClientTest, WildcardHostNameMatchCase_Online) {
|
||||
SSLClient cli("wWw.YouTube.Com");
|
||||
|
||||
cli.set_ca_cert_path(CA_CERT_FILE);
|
||||
cli.enable_server_certificate_verification(true);
|
||||
cli.enable_server_hostname_verification(true);
|
||||
cli.set_follow_location(true);
|
||||
|
||||
auto res = cli.Get("/");
|
||||
ASSERT_TRUE(res);
|
||||
ASSERT_EQ(StatusCode::OK_200, res->status);
|
||||
}
|
||||
|
||||
TEST(SSLClientTest, HostNameMatchCase_Online) {
|
||||
SSLClient cli("gOoGlE.COm");
|
||||
|
||||
cli.enable_server_certificate_verification(true);
|
||||
cli.enable_server_hostname_verification(true);
|
||||
cli.set_follow_location(true);
|
||||
|
||||
auto res = cli.Get("/");
|
||||
ASSERT_TRUE(res);
|
||||
ASSERT_EQ(StatusCode::OK_200, res->status);
|
||||
}
|
||||
|
||||
TEST(SSLClientTest, Issue2004_Online) {
|
||||
Client client("https://google.com");
|
||||
client.set_follow_location(true);
|
||||
|
||||
Reference in new issue
Block a user