mirror of https://github.com/omar-polo/gmid.git
making more explicit the case of missing SNI
Missing SNI (i.e. servname == NULL) is already handled correctly. puny_decode refuses to work on NULL servname, c->domain is still the empty string and everything flows as expected towards the error at the end. However, it's better to bail out early and make more explicit how the case of missing SNI is handled.
This commit is contained in:
parent
2b38d395cd
commit
79288c8b60
6
server.c
6
server.c
|
@ -464,7 +464,11 @@ handle_handshake(int fd, short ev, void *d)
|
|||
abort();
|
||||
}
|
||||
|
||||
servname = tls_conn_servername(c->ctx);
|
||||
if ((servname = tls_conn_servername(c->ctx)) == NULL) {
|
||||
log_debug(c, "handshake: missing SNI");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!puny_decode(servname, c->domain, sizeof(c->domain), &parse_err)) {
|
||||
log_info(c, "puny_decode: %s", parse_err);
|
||||
goto err;
|
||||
|
|
Loading…
Reference in New Issue