Do not hide sni domains with tls disabled

This commit is contained in:
Vadim Vetrov 2025-01-04 19:27:12 +03:00
parent 71c105a900
commit 40e1101d68
No known key found for this signature in database
GPG Key ID: E8A308689D7A73A5

View File

@ -824,23 +824,7 @@ static size_t print_config_section(const struct section_config_t *section, char
size_t sz; size_t sz;
if (section->tls_enabled) { if (section->tls_enabled) {
print_cnf_buf("--tls=enabled"); print_cnf_buf("--tls=enabled");
if (section->all_domains) {
print_cnf_buf("--sni-domains=all");
} else if (section->sni_domains != NULL) {
print_cnf_raw("--sni-domains=");
for (struct domains_list *sne = section->sni_domains; sne != NULL; sne = sne->next) {
print_cnf_raw("%s,", sne->domain_name);
}
print_cnf_raw(" ");
}
if (section->exclude_sni_domains != NULL) {
print_cnf_raw("--exclude-domains=");
for (struct domains_list *sne = section->exclude_sni_domains; sne != NULL; sne = sne->next) {
print_cnf_raw("%s,", sne->domain_name);
}
print_cnf_raw(" ");
}
switch(section->fragmentation_strategy) { switch(section->fragmentation_strategy) {
case FRAG_STRAT_IP: case FRAG_STRAT_IP:
@ -895,17 +879,7 @@ static size_t print_config_section(const struct section_config_t *section, char
print_cnf_buf("--fake-seq-offset=%d", section->fakeseq_offset); print_cnf_buf("--fake-seq-offset=%d", section->fakeseq_offset);
break; break;
} }
switch(section->sni_detection) {
case SNI_DETECTION_BRUTE:
print_cnf_buf("--sni-detection=brute");
break;
case SNI_DETECTION_PARSE:
print_cnf_buf("--sni-detection=parse");
break;
}
print_cnf_buf("--seg2delay=%d", section->seg2_delay); print_cnf_buf("--seg2delay=%d", section->seg2_delay);
} }
@ -913,6 +887,33 @@ static size_t print_config_section(const struct section_config_t *section, char
print_cnf_buf("--tls=disabled"); print_cnf_buf("--tls=disabled");
} }
if (section->all_domains) {
print_cnf_buf("--sni-domains=all");
} else if (section->sni_domains != NULL) {
print_cnf_raw("--sni-domains=");
for (struct domains_list *sne = section->sni_domains; sne != NULL; sne = sne->next) {
print_cnf_raw("%s,", sne->domain_name);
}
print_cnf_raw(" ");
}
if (section->exclude_sni_domains != NULL) {
print_cnf_raw("--exclude-domains=");
for (struct domains_list *sne = section->exclude_sni_domains; sne != NULL; sne = sne->next) {
print_cnf_raw("%s,", sne->domain_name);
}
print_cnf_raw(" ");
}
switch(section->sni_detection) {
case SNI_DETECTION_BRUTE:
print_cnf_buf("--sni-detection=brute");
break;
case SNI_DETECTION_PARSE:
print_cnf_buf("--sni-detection=parse");
break;
}
if (section->synfake) { if (section->synfake) {
print_cnf_buf("--synfake=1"); print_cnf_buf("--synfake=1");
print_cnf_buf("--synfake-len=%d", section->synfake_len); print_cnf_buf("--synfake-len=%d", section->synfake_len);