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.54k stars 367 forks source link

HTTP probe does not work #441

Closed Dmiriy closed 2 months ago

Dmiriy commented 4 months ago

/usr/sbin/sslh-ev -t 2 -f -n -u root --listen=x.x.x.x.:443 --http=localhost:80 Landlock: Failed to create a ruleset http: lost incoming connection

uname Linux ns 6.1.67-gentoo

I can’t understand what the problem is.

yrutschle commented 4 months ago

I guess your kernel does not support landlock, which should not be a problem. Does anything else not work?

17 mai 2024 08:53:31 Dmiriy @.***>:

/usr/sbin/sslh-ev -t 2 -f -n -u root --listen=x.x.x.x.:443 --http=localhost:80 Landlock: Failed to create a ruleset http: lost incoming connection

uname Linux ns 6.1.67-gentoo

I can’t understand what the problem is.

— Reply to this email directly, view it on GitHub[https://github.com/yrutschle/sslh/issues/441], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABGAU76UCD7SVISTTLCJDKDZCWSOPAVCNFSM6AAAAABH3RW6AKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDCOJWGEYTKOA]. You are receiving this because you are subscribed to this thread. [Image de pistage][https://github.com/notifications/beacon/ABGAU724TGEZ5A5XNCXTFMLZCWSOPA5CNFSM6AAAAABH3RW6AKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHISNJDYY.gif]

Dmiriy commented 4 months ago

I updated the kernel for 6.6.21 and added Landlock, but forwarding to http does not work.

yrutschle commented 4 months ago

Ok, "does not work" is not a very useful symptom :-) Can you run with verbose-connections, verbose-probe-info and verbose-packets set to 3, and report what happens?

Dmiriy commented 4 months ago

мая 31 14:27:11 ns sslh[63524]: hexdump of incoming packet: мая 31 14:27:11 ns sslh[63524]: 0x000000: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1.. мая 31 14:27:11 ns sslh[63524]: 0x000010: 48 6f 73 74 3a 20 39 35 2e 33 31 2e 31 32 2e 31 Host: X.x.x. мая 31 14:27:11 ns sslh[63524]: 0x000020: 36 39 3a 34 34 33 0d 0a 43 6f 6e 6e 65 63 74 69 x:443..Connecti мая 31 14:27:11 ns sslh[63524]: 0x000030: 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a on: keep-alive.. мая 31 14:27:11 ns sslh[63524]: 0x000040: 55 70 67 72 61 64 65 2d 49 6e 73 65 63 75 72 65 Upgrade-Insecure мая 31 14:27:11 ns sslh[63524]: 0x000050: 2d 52 65 71 75 65 73 74 73 3a 20 31 0d 0a 55 73 -Requests: 1..Us мая 31 14:27:11 ns sslh[63524]: 0x000060: 65 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c er-Agent: Mozill мая 31 14:27:11 ns sslh[63524]: 0x000070: 61 2f 35 2e 30 20 28 58 31 31 3b 20 4c 69 6e 75 a/5.0 (X11; Linu мая 31 14:27:11 ns sslh[63524]: 0x000080: 78 20 78 38 36 5f 36 34 29 20 41 70 70 6c 65 57 x x86_64) AppleW мая 31 14:27:11 ns sslh[63524]: 0x000090: 65 62 4b 69 74 2f 35 33 37 2e 33 36 20 28 4b 48 ebKit/537.36 (KH мая 31 14:27:11 ns sslh[63524]: 0x0000a0: 54 4d 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 TML, like Gecko) мая 31 14:27:11 ns sslh[63524]: 0x0000b0: 20 43 68 72 6f 6d 65 2f 31 32 35 2e 30 2e 30 2e Chrome/125.0.0. мая 31 14:27:11 ns sslh[63524]: 0x0000c0: 30 20 53 61 66 61 72 69 2f 35 33 37 2e 33 36 0d 0 Safari/537.36. мая 31 14:27:11 ns sslh[63524]: 0x0000d0: 0a 41 63 63 65 70 74 3a 20 74 65 78 74 2f 68 74 .Accept: text/ht мая 31 14:27:11 ns sslh[63524]: 0x0000e0: 6d 6c 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 ml,application/x мая 31 14:27:11 ns sslh[63524]: 0x0000f0: 68 74 6d 6c 2b 78 6d 6c 2c 61 70 70 6c 69 63 61 html+xml,applica мая 31 14:27:11 ns sslh[63524]: 0x000100: 74 69 6f 6e 2f 78 6d 6c 3b 71 3d 30 2e 39 2c 69 tion/xml;q=0.9,i мая 31 14:27:11 ns sslh[63524]: 0x000110: 6d 61 67 65 2f 61 76 69 66 2c 69 6d 61 67 65 2f mage/avif,image/ мая 31 14:27:11 ns sslh[63524]: 0x000120: 77 65 62 70 2c 69 6d 61 67 65 2f 61 70 6e 67 2c webp,image/apng, мая 31 14:27:11 ns sslh[63524]: 0x000130: 2a 2f 2a 3b 71 3d 30 2e 38 2c 61 70 70 6c 69 63 /;q=0.8,applic мая 31 14:27:11 ns sslh[63524]: 0x000140: 61 74 69 6f 6e 2f 73 69 67 6e 65 64 2d 65 78 63 ation/signed-exc мая 31 14:27:11 ns sslh[63524]: 0x000150: 68 61 6e 67 65 3b 76 3d 62 33 3b 71 3d 30 2e 37 hange;v=b3;q=0.7 мая 31 14:27:11 ns sslh[63524]: 0x000160: 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e ..Accept-Encodin мая 31 14:27:11 ns sslh[63524]: 0x000170: 67 3a 20 67 7a 69 70 2c 20 64 65 66 6c 61 74 65 g: gzip, deflate мая 31 14:27:11 ns sslh[63524]: 0x000180: 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 ..Accept-Languag мая 31 14:27:11 ns sslh[63524]: 0x000190: 65 3a 20 72 75 2d 52 55 2c 72 75 3b 71 3d 30 2e e: ru-RU,ru;q=0. мая 31 14:27:11 ns sslh[63524]: 0x0001a0: 39 2c 65 6e 2d 55 53 3b 71 3d 30 2e 38 2c 65 6e 9,en-US;q=0.8,en мая 31 14:27:11 ns sslh[63524]: 0x0001b0: 3b 71 3d 30 2e 37 0d 0a 0d 0a ;q=0.7.... мая 31 14:27:11 ns sslh[63524]: probing for ssh мая 31 14:27:11 ns sslh[63524]: probed for ssh: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for openvpn мая 31 14:27:11 ns sslh[63524]: probed for openvpn: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for tls мая 31 14:27:11 ns sslh[63524]: Request did not begin with TLS handshake. мая 31 14:27:11 ns sslh[63524]: probed for tls: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for http мая 31 14:27:11 ns sslh[63524]: probed for http: PROBE_MATCH мая 31 14:27:11 ns sslh[63524]: closing fd 21 мая 31 14:27:11 ns sslh[1208793]: trying to connect to ::1:80 family 10 len 28 мая 31 14:27:11 ns sslh[1208793]: forward to http failed:connect: Connection refused мая 31 14:27:11 ns sslh[1208793]: trying to connect to 127.0.0.1:80 family 2 len 16 мая 31 14:29:04 ns sslh[1208791]: forward to tls failed:connect: Connection timed out мая 31 14:29:04 ns sslh[1208791]: tcp-listener.c:243:connect: Connection timed out мая 31 14:29:04 ns sslh[1208790]: forward to tls failed:connect: Connection timed out мая 31 14:29:04 ns sslh[1208790]: tcp-listener.c:243:connect: Connection timed out

yrutschle commented 4 months ago

So, it all seems fine on sslh side and no one is listening on port 80 on IPv6, and IPv4 is timing out... Can you telnet on the http server?

31 mai 2024 13:31:07 Dmiriy @.***>:

мая 31 14:27:11 ns sslh[63524]: hexdump of incoming packet: мая 31 14:27:11 ns sslh[63524]: 0x000000: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1.. мая 31 14:27:11 ns sslh[63524]: 0x000010: 48 6f 73 74 3a 20 39 35 2e 33 31 2e 31 32 2e 31 Host: X.x.x. мая 31 14:27:11 ns sslh[63524]: 0x000020: 36 39 3a 34 34 33 0d 0a 43 6f 6e 6e 65 63 74 69 x:443..Connecti мая 31 14:27:11 ns sslh[63524]: 0x000030: 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a on: keep-alive.. мая 31 14:27:11 ns sslh[63524]: 0x000040: 55 70 67 72 61 64 65 2d 49 6e 73 65 63 75 72 65 Upgrade-Insecure мая 31 14:27:11 ns sslh[63524]: 0x000050: 2d 52 65 71 75 65 73 74 73 3a 20 31 0d 0a 55 73 -Requests: 1..Us мая 31 14:27:11 ns sslh[63524]: 0x000060: 65 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c er-Agent: Mozill мая 31 14:27:11 ns sslh[63524]: 0x000070: 61 2f 35 2e 30 20 28 58 31 31 3b 20 4c 69 6e 75 a/5.0 (X11; Linu мая 31 14:27:11 ns sslh[63524]: 0x000080: 78 20 78 38 36 5f 36 34 29 20 41 70 70 6c 65 57 x x86_64) AppleW мая 31 14:27:11 ns sslh[63524]: 0x000090: 65 62 4b 69 74 2f 35 33 37 2e 33 36 20 28 4b 48 ebKit/537.36 (KH мая 31 14:27:11 ns sslh[63524]: 0x0000a0: 54 4d 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 TML, like Gecko) мая 31 14:27:11 ns sslh[63524]: 0x0000b0: 20 43 68 72 6f 6d 65 2f 31 32 35 2e 30 2e 30 2e Chrome/125.0.0. мая 31 14:27:11 ns sslh[63524]: 0x0000c0: 30 20 53 61 66 61 72 69 2f 35 33 37 2e 33 36 0d 0 Safari/537.36. мая 31 14:27:11 ns sslh[63524]: 0x0000d0: 0a 41 63 63 65 70 74 3a 20 74 65 78 74 2f 68 74 .Accept: text/ht мая 31 14:27:11 ns sslh[63524]: 0x0000e0: 6d 6c 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 ml,application/x мая 31 14:27:11 ns sslh[63524]: 0x0000f0: 68 74 6d 6c 2b 78 6d 6c 2c 61 70 70 6c 69 63 61 html+xml,applica мая 31 14:27:11 ns sslh[63524]: 0x000100: 74 69 6f 6e 2f 78 6d 6c 3b 71 3d 30 2e 39 2c 69 tion/xml;q=0.9,i мая 31 14:27:11 ns sslh[63524]: 0x000110: 6d 61 67 65 2f 61 76 69 66 2c 69 6d 61 67 65 2f mage/avif,image/ мая 31 14:27:11 ns sslh[63524]: 0x000120: 77 65 62 70 2c 69 6d 61 67 65 2f 61 70 6e 67 2c webp,image/apng, мая 31 14:27:11 ns sslh[63524]: 0x000130: 2a 2f 2a 3b 71 3d 30 2e 38 2c 61 70 70 6c 69 63 ///;q=0.8,applic мая 31 14:27:11 ns sslh[63524]: 0x000140: 61 74 69 6f 6e 2f 73 69 67 6e 65 64 2d 65 78 63 ation/signed-exc мая 31 14:27:11 ns sslh[63524]: 0x000150: 68 61 6e 67 65 3b 76 3d 62 33 3b 71 3d 30 2e 37 hange;v=b3;q=0.7 мая 31 14:27:11 ns sslh[63524]: 0x000160: 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e ..Accept-Encodin мая 31 14:27:11 ns sslh[63524]: 0x000170: 67 3a 20 67 7a 69 70 2c 20 64 65 66 6c 61 74 65 g: gzip, deflate мая 31 14:27:11 ns sslh[63524]: 0x000180: 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 ..Accept-Languag мая 31 14:27:11 ns sslh[63524]: 0x000190: 65 3a 20 72 75 2d 52 55 2c 72 75 3b 71 3d 30 2e e: ru-RU,ru;q=0. мая 31 14:27:11 ns sslh[63524]: 0x0001a0: 39 2c 65 6e 2d 55 53 3b 71 3d 30 2e 38 2c 65 6e 9,en-US;q=0.8,en мая 31 14:27:11 ns sslh[63524]: 0x0001b0: 3b 71 3d 30 2e 37 0d 0a 0d 0a ;q=0.7.... мая 31 14:27:11 ns sslh[63524]: probing for ssh мая 31 14:27:11 ns sslh[63524]: probed for ssh: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for openvpn мая 31 14:27:11 ns sslh[63524]: probed for openvpn: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for tls мая 31 14:27:11 ns sslh[63524]: Request did not begin with TLS handshake. мая 31 14:27:11 ns sslh[63524]: probed for tls: PROBE_NEXT мая 31 14:27:11 ns sslh[63524]: probing for http мая 31 14:27:11 ns sslh[63524]: probed for http: PROBE_MATCH мая 31 14:27:11 ns sslh[63524]: closing fd 21 мая 31 14:27:11 ns sslh[1208793]: trying to connect to ::1:80 family 10 len 28 мая 31 14:27:11 ns sslh[1208793]: forward to http failed:connect: Connection refused мая 31 14:27:11 ns sslh[1208793]: trying to connect to 127.0.0.1:80 family 2 len 16 мая 31 14:29:04 ns sslh[1208791]: forward to tls failed:connect: Connection timed out мая 31 14:29:04 ns sslh[1208791]: tcp-listener.c:243:connect: Connection timed out мая 31 14:29:04 ns sslh[1208790]: forward to tls failed:connect: Connection timed out мая 31 14:29:04 ns sslh[1208790]: tcp-listener.c:243:connect: Connection timed out

— Reply to this email directly, view it on GitHub[https://github.com/yrutschle/sslh/issues/441#issuecomment-2141841052], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABGAU72R66VG5KV5YKJLGDTZFBNPPAVCNFSM6AAAAABH3RW6AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBRHA2DCMBVGI]. You are receiving this because you commented. [Image de pistage][https://github.com/notifications/beacon/ABGAU722JZVD3DUMMCCBRK3ZFBNPPA5CNFSM6AAAAABH3RW6AKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT7VHTJY.gif]

yrutschle commented 2 months ago

Closing due to lack of response and probably not an sslh issue. Please reopen if anything new turns up.