mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-13 17:00:19 +00:00
do not fallback to CN after SAN
This commit is contained in:
1 parent
c835c72202
commit
454bf4036f
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1904,7 +1904,7 @@ static int mg_tls_recv_cert(struct mg_connection *c, bool is_client) {
|
||||
bool is_addr = mg_aton_(mg_str_s(tls->hostname), &addr);
|
||||
if (mg_tls_verify_cert_san(cert, certsz, tls->hostname,
|
||||
is_addr ? &addr : NULL) <= 0 &&
|
||||
(!is_addr || // DNS CN fallback
|
||||
(is_addr || // IP references require a matching SAN
|
||||
mg_tls_verify_cert_cn(&ci->subj, tls->hostname) <= 0)) {
|
||||
mg_error(c, "failed to verify hostname");
|
||||
return -1;
|
||||
|
||||
Reference in new issue
Block a user