tlspr: the SNI break split sent once the destination is connected

This commit is contained in:
Vladimir Dubrovin committed 2026-11-26 15:39:07 +03:00
1 parent d323ab2d5a
commit 0d2554614d
1 file changed
+13 -10
+13 -10
View File
@@ -335,6 +335,7 @@ void * tlsprchild(struct clientparam* param) {
int lv=-1;
char proto[PROTOLEN]="-";
int snipos = 0;
int snlen = 0;
PROXYSERVICE stlsproto = param->clientstarttls? param->clientstarttls :
(param->starttls? param->starttls : param->srv->srvstarttls);
@@ -358,16 +359,7 @@ void * tlsprchild(struct clientparam* param) {
}
else if (parsehostname(sni, param, param->srv->targetport? ntohs(param->srv->targetport):starttlsport(stlsproto))) RETURN (100);
if (!param->hostname)param->hostname = (unsigned char *)strdup(sni);
if(param->srv->s_option && snipos && res > 1){
int len;
len = socksend(param, param->remsock, param->clibuf+param->clioffset,snipos + (res/2), conf.timeouts[STRING_S]);
if(len != snipos + (res/2)){
RETURN(310);
}
param->clioffset += snipos + (res/2);
}
snlen = res;
}
else if (res < 0 && param->srv->requirecert) RETURN(310-res);
}
@@ -387,6 +379,17 @@ void * tlsprchild(struct clientparam* param) {
return (void *)param->redirectfunc;
}
if(param->srv->s_option && snipos && snlen > 1){
int len;
len = socksend(param, param->remsock, param->clibuf+param->clioffset,snipos + (snlen/2), conf.timeouts[STRING_S]);
if(len != snipos + (snlen/2)){
RETURN(310);
}
param->clioffset += snipos + (snlen/2);
}
if(stlsproto){
res = srvstarttls(param, stlsproto);
if(res){