yrutschle / sslh

Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)
https://www.rutschle.net/tech/sslh/README.html
GNU General Public License v2.0
4.56k stars 368 forks source link

Bug: The default configuration is invalid (`sslhcfg: invalid option "--ssl"`) #473

Open Colk-tech opened 4 weeks ago

Colk-tech commented 4 weeks ago

When I tried to install sslh on Ubuntu 22.04 via apt, I noticed that the --ssl option in the default configuration is invalid. Shouldn't it be --tls instead? I'm sorry if this is already fixed in new versions.

Version

sslh-fork 1.22c-1

default config

DAEMON=/usr/sbin/sslh

DAEMON_OPTS="--user sslh --listen <change-me>:443 --ssh 127.0.0.1:22 --ssl 127.0.0.1:443"

log

Sep 28 19:18:17 160-251-7-236 systemd[1]: Started sslh.service - SSL/SSH multiplexer.
Sep 28 19:18:17 160-251-7-236 sslh[5587]: sslhcfg: invalid option "--ssl"
Sep 28 19:18:17 160-251-7-236 sslh[5587]: sslhcfg: unexpected argument "127.0.0.1:443"
Sep 28 19:18:17 160-251-7-236 sslh[5587]:  [-Vfin] [-F <file>] [-v <n>] [--transparent] [-t <n>] [-u <str>] [-P <file>] [-C <path>] [--syslog-facility=<str>] [--on-timeout=<str>] [--prefix=<str>] [-p <host:port>>
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -F, --config=<file>              Specify configuration file
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -v, --verbose=<n>
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -V, --version                    Print version information and exit
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -f, --foreground                 Run in foreground instead of as a daemon
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -i, --inetd                      Run in inetd mode: use stdin/stdout instead of network listen
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -n, --numeric                    Print IP addresses and ports as numbers
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --transparent                    Set up as a transparent proxy
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -t, --timeout=<n>                Set up timeout before connecting to default target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -u, --user=<str>                 Username to change to after set-up
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -P, --pidfile=<file>             Path to file to store PID of current instance
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -C, --chroot=<path>              Root to change to after set-up
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --syslog-facility=<str>          Facility to syslog to
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --on-timeout=<str>               Target to connect to when timing out
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --prefix=<str>                   Reserved for testing
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   -p, --listen=<host:port>         Listen on host:port
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --ssh=<host:port>                Set up ssh target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --tls=<host:port>                Set up TLS/SSL target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --openvpn=<host:port>            Set up OpenVPN target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --tinc=<host:port>               Set up tinc target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --xmpp=<host:port>               Set up XMPP target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --http=<host:port>               Set up HTTP (plain) target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --adb=<host:port>                Set up ADB (Android Debug) target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --socks5=<host:port>             Set up socks5 target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --syslog=<host:port>             Set up syslog target
Sep 28 19:18:17 160-251-7-236 sslh[5587]:   --anyprot=<host:port>            Set up default target
Sep 28 19:18:17 160-251-7-236 systemd[1]: sslh.service: Main process exited, code=exited, status=6/NOTCONFIGURED
Sep 28 19:18:17 160-251-7-236 systemd[1]: sslh.service: Failed with result 'exit-code'.
ftasnetamot commented 1 week ago

You must have another Ubuntu 22.04 than me. I my Ubuntu 22.04.5 LTS I get an sslh 1.20-1, when installing it with apt. And yes, the configuration option in /etc/default/sslh has the obsolete --ssl option in the template. However you need to open a bug with ubuntu, as this is part of their packaging.

stokito commented 1 week ago

Duplicate of #416