Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

How to use ssl over socks5 via tun2socks #87

Open
578141611 opened this issue Aug 21, 2019 · 7 comments
Open

How to use ssl over socks5 via tun2socks #87

578141611 opened this issue Aug 21, 2019 · 7 comments

Comments

@578141611
Copy link

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; }

@4-FLOSS-Free-Libre-Open-Source-Software

can't stunnel without modifying help you with that?

@ambrop72
Copy link
Owner

ambrop72 commented Aug 21, 2019

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).

@578141611
Copy link
Author

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
Copy link
Author

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

@xDragonZ
Copy link

Can you share us your implementation?

@4-FLOSS-Free-Libre-Open-Source-Software

Can you share us your implementation?

@578141611 Please?

@578141611
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants