badvpn icon indicating copy to clipboard operation
badvpn copied to clipboard

How to use ssl over socks5 via tun2socks

Open 578141611 opened this issue 6 years ago • 7 comments

There is new requirement to use ssl wrapping socks5 data.I already read the source code of tun2socks,but I find it is hard to implement this reqirement by modifying code.I want to use the BSSLConntion.c ,but I can not insert the code in here: // init SOCKS if (!BSocksClient_Init(&client->socks_client, socks_server_addr, socks_auth_info, socks_num_auth_info, addr, (BSocksClient_handler)client_socks_handler, client, &ss)) { BLog(BLOG_ERROR, "listener accept: BSocksClient_Init failed"); goto fail1; }

578141611 avatar Aug 21 '19 13:08 578141611

can't stunnel without modifying help you with that?

I would indeed recommend an external approach like stunnel. Though it would be possible to add support for SSL based on the NSS library (not OpenSSL), since there is already NSS integration code present (https://github.com/ambrop72/badvpn/blob/master/nspr_support/BSSLConnection.h which is a layer that you insert on top of BConnection).

ambrop72 avatar Aug 21 '19 16:08 ambrop72

I try to use openssl + bio to implement ssl over socks5,but I fail. @ambrop72 can you answer such question: (1)Why introduce PacketStreamSender In socksclient,but do not use in tun2socks.In my opinion,We should keep same socksclient and tun2socks (2)why all done opertion do not provide data buffer?

578141611 avatar Aug 27 '19 06:08 578141611

@ambrop72 I have already add ssl over socks5 in tun2socks.

578141611 avatar Oct 19 '19 02:10 578141611

Can you share us your implementation?

xDragonZ avatar Jan 21 '20 06:01 xDragonZ

Can you share us your implementation?

@578141611 Please?

@xDragonZ @4-FLOSS-Free-Libre-Open-Source-Software I can not shared the code,beacace of the limit of my company

578141611 avatar May 30 '20 06:05 578141611