-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sslh and stunnel configuration not working #261
Comments
Update: I noticed the sslh / stunnel example uses stunnel3 but the current version is stunnel4 which does not have the "-l", "-d", "-p" and "-f" parameters. I modified
And now when I connect with
Here is the debug log of the command
I don't know why it says |
Update 2: it looks like proxytunnel is not needed to use sslh and stunnel. Now sslh and stunnel are working together with the configuration below (based on https://grox.net/sysadm/net/ssh_via_ssl_tunnel.howto) but I cannot get the transparent mode to work when using stunnel and sslh together in order to display the incoming IP address in my Apache web server logs (it only works when using sslh without stunnel). Here is the file
I had to comment the transparent option since it blocked the SSH and HTTPS connection to my server. Here is the file
I started stunnel (which uses sslh) on the server with the command Do you have an idea what needs to be done in order to see the incoming IP address when using sslh with stunnel? |
Update 3: I have found a way to use sslh and stunnel in transparent mode but for IPv4 only, by replacing this line (from https://github.com/yrutschle/sslh/blob/master/doc/config.md#transparent-proxy-support): Is this the best way to do it? Any idea to make IPv6 work in a similar way? At the moment, I only managed to get both IPv4 and IPv6 addresses in the web server log if I am using stunnel without sslh (or sslh without stunnel), using this configuration in
In my
Does sslh inetd mode support IPv6 correctly with transparent proxy? |
I wouldn't expect inetd to work with transparent proxying (inetd would handle the external connection and sslh would only get data from stdin, so basically with inetd I would except sslh to not even know about the client IP). But I could be wrong, I haven't really used inetd much. On the other hand, sslh should be largely agnostic to the IP version you're using. Whatever works in IPv4 should work the same in IPv4, except maybe for address parsing. |
@yrutschle so it is not possible to use sslh with stunnel and keep the original IP address? It looks like there was only a problem with IPv6 when I tested, maybe a software bug in sslh when using inetd mode and transparent proxy. |
I'm not sure what I said anymore :-) What I say is:
|
@yrutschle thanks for trying to help. If we want to use sslh with stunnel, we have no other choice than using inetd? (the example from your documentation is using inetd) |
Hello, I would like to use SSH on port 443 and encapsulate the traffic with SSL in case I will use an Internet connection that only allows port 443 and SSL traffic.
I started sslh and stunnel like that (based on the example https://github.com/yrutschle/sslh/blob/master/doc/config.md#using-proxytunnel-with-sslh):
sudo stunnel /etc/stunnel/stunnel.conf -f -d vps:443 -l /usr/sbin/sslh -- sslh -i --ssh localhost:22
The domain name "vps" is defined in the file
/etc/hosts
of the server and points to the public IPv4 and IPv6 address of my VPS.Compared to the example, did not need to use
--http localhost:80
and I had to add the configuration file/etc/stunnel/stunnel.conf
with stunnel4, otherwise there is an error. Here is what the configuration file contains:Then on my laptop, I installed proxytunnel and configured SSH like that in
.ssh/config
(based on instructions from https://github.com/proxytunnel/proxytunnel) where the domain name "vps" is also defined in the/etc/hosts
file of my laptop and points to the public IPv4 and IPv6 address of my VPS:I think using the
-d
parameter should not be needed since sslh would detect the SSH traffic should go to port 22 but proxytunnel needed this parameter.When I try to connect using the command
ssh mytunnel
, I can see this error message:Do you have an idea what is wrong with my configuration?
By the way, is it necessary to run sslh in inetd mode when using stunnel? On the page https://www.stunnel.org/howto.html, I read "Running in daemon mode is much preferred to running in inetd mode.".
Thanks.
The text was updated successfully, but these errors were encountered: