Or it would work merely modifying "socks_server_middle" (add the fix at the beginning of function) function, since I need only "protocol = socks" to be fixed: SSL_SESSION *sess; void *ex_data;
if(!c->ssl) return; else { sess=SSL_get1_session(c->ssl); if(!sess) return; else { ex_data=SSL_SESSION_get_ex_data(sess, index_session_authenticated); SSL_SESSION_free(sess); if (ex_data == NULL) return; } }
I checked it out. No double "Redirecting connection" anymore, also "socks" works as expected and redirects to 127.0.0.1:80 when there's no verified peer is connected (from browsers for an example).