FIX: SSLPlugin with SOCKS

This commit is contained in:
Vladimir Dubrovin 2022-05-19 13:26:52 +03:00
parent d20e76bbc9
commit 1cf169b7ae
2 changed files with 15 additions and 2 deletions

View File

@ -310,11 +310,11 @@ static FILTER_ACTION ssl_filter_client(void *fo, struct clientparam * param, voi
} }
static FILTER_ACTION ssl_filter_predata(void *fo, struct clientparam * param){ static FILTER_ACTION ssl_filter_predata(void *fo, struct clientparam * param){
if(param->operation != HTTP_CONNECT) return PASS; if(param->operation != HTTP_CONNECT && param->operation != CONNECT) return PASS;
if(dossl(param, NULL, NULL)) { if(dossl(param, NULL, NULL)) {
return REJECT; return REJECT;
} }
param->redirectfunc = proxyfunc; if(!param->redirectfunc) param->redirectfunc = proxyfunc;
return CONTINUE; return CONTINUE;
} }

View File

@ -203,6 +203,8 @@ void * sockschild(struct clientparam* param) {
RETURN(res); RETURN(res);
} }
if(command > 1) { if(command > 1) {
if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,SASIZE(&param->sinsl))) { if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,SASIZE(&param->sinsl))) {
*SAPORT(&param->sinsl) = 0; *SAPORT(&param->sinsl) = 0;
@ -272,6 +274,17 @@ fflush(stderr);
socksend(param->clisock, buf, 8, conf.timeouts[STRING_S]); socksend(param->clisock, buf, 8, conf.timeouts[STRING_S]);
} }
if (param->npredatfilters){
int action;
action = handlepredatflt(param);
if(action == HANDLED){
param->res = 0;
}
if(action != PASS){
param->res = 19;
}
}
if (param->res == 0) { if (param->res == 0) {
switch(command) { switch(command) {
case 1: case 1: