woman-lifefreedom / sslsockspro

GNU General Public License v3.0
4 stars 2 forks source link

PSK / no certificates / Accept ports not accepted #2

Open aldweb opened 6 months ago

aldweb commented 6 months ago

Hello,

I had developed a stunnel wrapper some years ago but it required rooting the android device. Since I'd rather not root my brand new device, I started to use your great SSLSocks Pro app, as it does not require root to run stunnel, this is great.

I met three issues so far (2 minor and 1 major) :

1/ [minor] I use PSK to authenticate my communications between the client and the server.

This was a nice feature included in SSLSocks and it has not been ported to SSLSocks Pro. I found a workaround by finding a way to put the stunnel.psk file in a directory which can be accessed by SSLSocks (following these instructions) and integrating it in the config file:

remark = stunnel
foreground = yes
client = yes
ciphers = PSK
PSKsecrets = /storage/emulated/0/Android/data/link.infra.sslsockspro/files/stunnel.psk

2/ [minor] Log reports "No trusted certificates found" for all configured connections.

If I insert the default stunnel.pem file in the CERTS / KEYS and add the following line in the config file (as per this instruction): cert = stunnel.pem then, I get a full bunch of errors in the LOG, the first one being:

error queue: /tmp/ASP/SSLSocksPro/app/src/main/cpp/openssl/ssl/ssl_rsa.c:448: error:0A080002:SSL routines::system lib

Same thing occurs when I am following your instructions in this closed issue, by just replacing SSLStock to SSLStocksPro:

cert = /data/user/0/link.infra.sslsockspro/files/.pem
key = /data/user/0/link.infra.sslsockspro/files/.pem

3/ [major] When I only had a few connections set up, like:

[someAccess]
accept = 127.0.0.1:50065
connect = <server.ext>:50065

then stunnel worked like a charm. But when you go over adding connections, there are many accept ports for which the system hangs and does not work at all and Log reports:

Address already in use (98) Binding service [Access12] failed

Since I have something like 100 connections defined in my config file, I must say that I am a little bit blocked at the time to activate my new phone. And I am wondering why some ports are not valid (they used to be in my own stunnel wrapper).

I hope that this report will help you, and keep the good work, Cheers!

aldweb commented 6 months ago

Update on issue 3/ Replacing all 5xxxx ports by 4xxxx ports did the trick! I wonder why, but it now works. Cheers!

aldweb commented 5 months ago

No I did not, sorry. Cheers, aldweb

tsjk commented 5 months ago

I've noticed some of the same issues. For PSKs, you could just paste your PSK data in a certs/keys config and use that as a psk. That is much easier than externally putting extra files into the app's storage. Like

[monero-rpc]
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
PSKsecrets = /data/data/link.infra.sslsockspro/files/PSKsecrets.pem
sslVersion = TLSv1.3
accept = 127.0.0.1:18081
connect = remote.host:18081

Here, PSKsecrets.pem contains a <identity>:<key> pair.

I have not figured out why it hangs temporarily yet. It does not always happen.

aldweb commented 4 months ago

This is a very smart workaround, I will try it, thank you tsjk.