mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
tlspr: the SNI break split sent once the destination is connected
This commit is contained in:
1 parent
37f7c3d1a7
commit
68489713b8
1 file changed
+13
-10
+13
-10
@@ -310,6 +310,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);
|
||||
|
||||
@@ -331,16 +332,7 @@ void * tlsprchild(struct clientparam* param) {
|
||||
if(PARAMSTR(param, hostname, sni)) RETURN (100);
|
||||
}
|
||||
else if (parsehostname(sni, param, param->srv->targetport? ntohs(param->srv->targetport):starttlsport(stlsproto))) RETURN (100);
|
||||
if(param->srv->s_option && snipos && res > 1){
|
||||
int len;
|
||||
|
||||
len = socksend(param, param->remsock, param->clibuf+param->clioffset,snipos + (res/2), param->srv->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);
|
||||
}
|
||||
@@ -360,6 +352,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), param->srv->timeouts[STRING_S]);
|
||||
if(len != snipos + (snlen/2)){
|
||||
RETURN(310);
|
||||
}
|
||||
param->clioffset += snipos + (snlen/2);
|
||||
|
||||
}
|
||||
|
||||
if(stlsproto){
|
||||
res = srvstarttls(param, stlsproto);
|
||||
if(res){
|
||||
|
||||
Reference in new issue
Block a user