Skip to content
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

wstunnel::tunnel::server: error while decoding jwt for tunnel info Err(Error(InvalidToken)) header None #329

Closed
cybergatto opened this issue Aug 9, 2024 · 1 comment
Labels

Comments

@cybergatto
Copy link

cybergatto commented Aug 9, 2024

I'm tring to open a tunnel using the folliwing path

PC on public internet --> wss://wstunnel.mydomain.onl:443 (on cloudflare) ---> wss://myrealserverip:443 (apache reverse proxy) --> ws://localhost:8443 (wstunnel on docker server)

command used on client to open the tunnel

wstunnel.exe client -L udp://13231:192.168.88.1:13231?timeout_sec=0 wss://wstunnel.mydomain.onl:443

docker configuration is plain

    wstunnel:
      image: ghcr.io/erebe/wstunnel
      ports:
        - 8443:8443
      environment:
        - RUST_LOG=INFO
        - SERVER_PROTOCOL=ws
        - SERVER_LISTEN=[::]
        - SERVER_PORT=8443
      restart: always

apache configuration is simple as well

<VirtualHost *:443>
    SSLEngine on
    #SSLProxyEngine on
    #SSLProxyCheckPeerName off
    #SSLProxyVerify none
    #ProxyPreserveHost off
    SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    ServerAlias wstunnel.mydomain.onl
    ProxyPass / http://localhost:8443/
    ProxyPassReverse / http://localhost:8443/
    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://localhost:8443/$1" [P,L]
</VirtualHost>

on client log i get the following:

C:\Windows\System32>wstunnel.exe client -L udp://13231:192.168.88.1:13231?timeout_sec=0 wss://wstunnel.mydomain.onl:443
←[2m2024-08-09T08:31:41.813027Z←[0m ←[32m INFO←[0m ←[2mwstunnel::udp←[0m←[2m:←[0m Starting UDP server listening cnx on 127.0.0.1:13231 with cnx timeout of 0s
←[2m2024-08-09T08:31:46.059614Z←[0m ←[32m INFO←[0m ←[2mwstunnel::udp←[0m←[2m:←[0m New UDP connection from 127.0.0.1:63728
←[2m2024-08-09T08:31:46.060495Z←[0m ←[32m INFO←[0m ←[2mwstunnel::tcp←[0m←[2m:←[0m Opening TCP connection to wstunnel.mydomain.onl:443
←[2m2024-08-09T08:31:46.646498Z←[0m ←[32m INFO←[0m ←[2mwstunnel::tls←[0m←[2m:←[0m Doing TLS handshake using sni DnsName("wstunnel.mydomain.onl") with the server wstunnel.mydomain.onl:443
←[2m2024-08-09T08:31:54.646181Z←[0m ←[31mERROR←[0m ←[1mtunnel←[0m←[1m{←[0m←[3mid←[0m←[2m=←[0m"01913643-e98c-7798-9710-a1a3771f16ee" ←[3mremote←[0m←[2m=←[0m"192.168.88.1:13231"←[1m}←[0m←[2m:←[0m ←[2mwstunnel::tunnel::client←[0m←[2m:←[0m failed to do websocket handshake with the server (Domain("wstunnel.mydomain.onl"), 443)

Caused by:
    Invalid status code: 400
←[2m2024-08-09T08:31:54.646468Z←[0m ←[32m INFO←[0m ←[2mwstunnel::udp←[0m←[2m:←[0m New UDP connection from 127.0.0.1:63728
←[2m2024-08-09T08:31:54.646753Z←[0m ←[32m INFO←[0m ←[2mwstunnel::tcp←[0m←[2m:←[0m Opening TCP connection to wstunnel.mydomain.onl:443

on server log i get:

wstunnel_1   | 2024-08-09T08:04:43.450526Z  INFO wstunnel::tunnel::server: Accepting connection
wstunnel_1   | 2024-08-09T08:04:43.450604Z  INFO tunnel{peer="[::ffff:172.18.0.1]:54890"}: wstunnel::tunnel::server: Request X-Forwarded-For: 109.55.48.225
wstunnel_1   | 2024-08-09T08:04:43.450617Z  WARN tunnel{peer="[::ffff:172.18.0.1]:54890" forwarded_for="109.55.48.225"}: wstunnel::tunnel::server: error while decoding jwt for tunnel info Err(Error(InvalidToken)) header None
@cybergatto cybergatto added the bug label Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

Hello @cybergatto 👋

This issue is being automatically closed because it does not follow the issue template.

@github-actions github-actions bot closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant