warn about punycode in server definition

This commit is contained in:
Omar Polo 2021-01-28 16:27:40 +00:00
parent 9a672b3712
commit cbeee4cad1
1 changed files with 6 additions and 0 deletions

View File

@ -86,6 +86,12 @@ vhost : TSERVER TSTRING '{' servopts locations '}' {
host->locations[0].match = (char*)"*";
host->domain = $2;
if (strstr($2, "xn--") != NULL) {
warnx("%s:%d \"%s\" looks like punycode: "
"you should use the decoded hostname."
config_path, yylineno);
}
if (host->cert == NULL || host->key == NULL ||
host->dir == NULL)
errx(1, "invalid vhost definition: %s", $2);