Giter VIP home page Giter VIP logo

sslsocks's Introduction

SSLSocks

โœจ See this article by Hamy for an excellent introduction to the app!

Now released as a beta on Google Play! https://play.google.com/store/apps/details?id=link.infra.sslsocks

SSL/TLS tunnel using stunnel for Android.

Note: Originally intended to be a socks5 VPN through TLS, but I never finished implementing the VPN service.

Build instructions

  1. Install Android Studio
  2. Download the stunnel android binary from stunnel.org, and copy it to /app/src/main/assets/stunnel
  3. Build it using Android Studio

How to use

To edit the configuration, tap the top menu then press Config Editor. Then add your settings according to the stunnel documentation.

Stunnel should start when you press the start button, and will create a notification while it is being run. If the notification is immediately removed after being created, there was an error, so you will need to check the log (second tab).

Please note that currently the log is only updated when stunnel stops, so you will need to press the stop button to view it. Currently there are also some problems with sending the log to the screen, so make sure you have the app open when you stop it.

How to configure stunnel

Some example configurations are available in the stunnel documentation, and more are given below. Many use cases (e.g. tunnelling SSH or SOCKS over HTTPS) require you to run an stunnel server, which you can download from the stunnel website.

The stunnel binary functions as both a server and a client, as long as you put client = yes at the top of your config file when you want to use it as a client. This is set by default in the app.

SSH over HTTPS

Client
[ssh]
accept = 10000
connect = example.com:443

Connect to 127.0.0.1:10000 in your SSH client.

Server
[ssh]
accept = 443
connect = 127.0.0.1:22

SOCKS

Client
[rdp]
accept = 9050
connect = example.com:443

Connect to 127.0.0.1:9050 in your SOCKS client. Orfox works well for this on android.

Server
[rdp]
accept = 443
protocol = socks

RDP

Client
[rdp]
accept = 3380
connect = example.com:443

Connect to 127.0.0.1:3380 in your RDP client.

Server
[rdp]
accept = 443
connect = 127.0.0.1:3389

SNI

SNI allows you to have multiple tunnels on one server, as many firewalls only allow port 443.

Client
[default]
accept = 8080
connect = example.com:443

[ssh]
accept = 10000
connect = example.com:443
sni = ssh.example.com
Server
[default]
accept = 443
connect = 127.0.0.1:8080

[ssh]
sni = default:ssh.example.com
connect = 127.0.0.1:22

sslsocks's People

Contributors

comp500 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sslsocks's Issues

integration with OpenVPN

Hi,
Do you know if you can integrate this app to make it work as a tunnel for OpenVPN (https://github.com/schwabe/ics-openvpn)?
To make them work as one app with one click.
Currently I am using them together to connect OpenVPN server as I have some networks where OpenVPN is blocked by deep packet inspection and the only tool works is Stunnel.

This OpenVPN client has the the ability to exclude apps from it's routing system so when you connect the VPN, the Stunnel stays with direct connection that doesn't go through the VPN.

Are you able to combine SSLSocks(Stunnel) and the OpenVPN functionality in that client together in one App so when you press one button it will automatically activate Stunnel, then OpenVPN connects through it?

Regards.

Address already in use

Hi @comp500
I am trying to configure in Android Nougat, but I found this error! Can you please explain why I am getting this error?

LOG5[ui]: stunnel 5.49 on arm-unknown-linux-androideabi platform
LOG5[ui]: Compiled/running with OpenSSL 1.1.0i 14 Aug 2018
LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,FIPS,OCSP,PSK,SNI
LOG5[ui]: Reading configuration from file /data/data/link.infra.sslsocks/files/config.conf
LOG5[ui]: UTF-8 byte order mark not detected
LOG5[ui]: FIPS mode disabled
LOG4[ui]: Service [squid] needs authentication to prevent MITM attacks
LOG5[ui]: Configuration successful
LOG5[ui]: Binding service [squid] to 127.0.0.1:8080: Address already in use (98)

adding config to APK

HI.
I'd like to add to apk prepared configuration and client cert PEM.
Tried to copy config.conf or stunnel.conf to assets using aapt - didn't work.
Please explain how this can be done.

P.S. I have no problems with apk signing and installation.

Question: Using android-integrated CA-Certs possible?

Hello,

I am using a Cert from Let's Encrypt on my stunnel Server.
On my Clients (here my Android devices), I want to use the Parameter CApath.
Is it possible the CA-Certs of android for SSLSocks?
Because Let's Encrypt is a official CA-Authority (certified itself by DST Root CA X3), all Certs from Let's Encrypt should be verified automatically.
What is the correct path for these Certs so that I get a complete CA-Hierachie?

Thanks.

ANDROID_DATA not set!

First lines of Log shows:
__bionic_open_tzdata_path: ANDROID_DATA not set!
__bionic_open_tzdata_path: ANDROID_ROOT not set!

But Configuration successful

Any idea how to fix it?
Im using SSH.

Can't open pem/pfx files which are password protected

Hi,

I love this app, it is by far better than what i was using before in Android and love the ability to edit stunnel.conf from the UI.

However you can't open passphrase protected pfx or pem files. It is much safer to store them encrypted than in plain text on the phone.

Thanks.

android 10 fix

java.io.IOException: Cannot run program

java.io.IOException: error=13, Permission denied

fix please android 10

Google Play

Hi there,

I'm wondering if you have any plans to release SSLSocks on the Play Store. If funding is an issue, I'd be happy to let you use my Google Play License to put it on the Play Store.

Thanks for the awesome app!

update to stunnel 5.55

hi
would you please release new version with latest stunnel 5.55?
thanks for your time.

Caused by: java.io.IOException: error=13, Permission denied

Hi,

I am getting below error on device Android 11 (OnePlus 8)

E/StunnelProcessManager: failure
    java.io.IOException: Cannot run program "/data/user/0/link.infra.sslsocks/files/stunnel" (in directory "/data/user/0/link.infra.sslsocks/files"): error=13, Permission denied
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
        at java.lang.Runtime.exec(Runtime.java:699)
        at java.lang.Runtime.exec(Runtime.java:529)
        at link.infra.sslsocks.service.StunnelProcessManager.start(StunnelProcessManager.java:106)
        at link.infra.sslsocks.service.StunnelIntentService.handleStart(StunnelIntentService.java:81)
        at link.infra.sslsocks.service.StunnelIntentService.onHandleIntent(StunnelIntentService.java:69)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:77)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:245)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: java.io.IOException: error=13, Permission denied
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
        at java.lang.ProcessImpl.start(ProcessImpl.java:141)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

PKCS12: Error "Header too long"

Hello,

i installed SSLSocks App from Google Playstore.
Now I get an error after loading the p12-File.
The Log is saying: d2i_PKCS12_BIO: crypto/asn1/asn1_lib.c:101:error:0D07207B:asn1 encoding routines:ASN1_get_object: header too long

Is there anything i can do?

My config:

foreground = yes
pid = /data/user/0/link.infra.sslsocks/files/pid
sslVersionMin = TLSv1.2
checkHost = xxxxx.myftp.org
verifyChain = yes
CAfile= fullchain1.pem

cert = android1.p12
key = android1.pem

sslVersionMin = TLSv1.2

[openvpn]
client = yes
accept = 0.0.0.0:55554
connect = xxxxx.myftp.org:443

Archived

Hi! I've realised I don't really have the time or energy to maintain this project, nor do I have much use for it myself anymore. As the license permits, others are welcome to fork and continue the project. The app as is on the Play Store will not receive new updates, and in its current state is becoming unusable with newer Android versions due to restrictions on native code execution.

For alternatives, I'd recommend WireGuard, Tailscale, or I believe you can use Termux to run the stunnel CLI directly.

help me Constants

public static final String DEF_CONFIG =
        "foreground = yes\n" +
                "client = yes\n" +
				"pid = \n" +
                "[shadowsock]\n" +
	        	"accept= 2323\n" +
	        	"connect= 127.0.0.1:8443\n" +
	        	"sni= example.com";

"=" sign expected between the "[...]" ?

Working Config on PC:

[test1]
accept = 127.0.0.1:x
connect = x:443
ciphers = x
sslVersionMin = x
curve = x
verifyChain = yes
CApath = ??? (no idea where is it on Android)
checkHost = x
OCSPaia = yes

Capture

stunnel 5.56 update

Hi and thanks for this app.is there any chance to get the updated version with stunnel 5.56?

connected remote server from *****

I see some logs in the application and worry about them.
for example :
connected remote server from 21.67.126.159
what does this line of log say?

photo_2023-01-13_03-25-05 (2)

How to use it?

I read this manual (https://hamy.io/post/0011/how-to-run-stunnel-on-your-android-device/), added my certificate, added part of the config, pressed start, but nothing happens. I don't see anything in the logs on my stunnel server. I also have a stunnel-cli for android with the same config and certificate, which I run from the terminal, it works. Well, the most incomprehensible thing is how the browser on android should use this proxy? When I use stunnel-cli from the terminal, I create a new access point (APN) in the network settings (not wifi) and specify the proxy server 127.0.0.1:8443 there.
My config (to be added to what is already suggested):

cert = /data/local/tmp/etc/stunnel/stunnel.pem
CAfile = /data/local/tmp/etc/stunnel/stunnel.pem
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1

[server]
accept = 127.0.0.1:8443
connect = XX.XX.XX.XX:8443
verify = 2

Android 10 error resolving 127.0.0.1

Hi,I have been using this tunnel app for few years with no issues.but for the first time using android 10 I can not connect.I am using it as a wrapper for openvpn traffic.same config is running on other 3 phone devices smoothly.
here is the error;
"error resolving 127.0.0.1 : neither nodename nor servname known(EAI_NONAME)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.