bolkedebruin / rdpgw

Remote Desktop Gateway in Go for deploying on Linux/BSD/Kubernetes
Apache License 2.0
698 stars 115 forks source link

Websocet problem:invalid memory address or nil pointer dereference #47

Closed Lordinium closed 1 year ago

Lordinium commented 1 year ago

Hi! Sorry, I don't speak much English. Im compile your project. Configuration succes and run rdpgw binary. Try connect websocet application writte error massage: runtime error: invalid memory address or nil pointer dereference goroutine 51 [running]: net/http.(*conn).serve.func1() net/http/server.go:1850 +0xbf panic({0xa76f00, 0x102c100}) runtime/panic.go:890 +0x262 github.com/bolkedebruin/rdpgw/cmd/rdpgw/api.(*Config).HandleDownload(0xc00022b540, {0xc39e80, 0xc000458000}, 0xc00015a700) github.com/bolkedebruin/rdpgw/cmd/rdpgw/api/web.go:279 +0xae2 net/http.HandlerFunc.ServeHTTP(...) net/http/server.go:2109 github.com/bolkedebruin/rdpgw/cmd/rdpgw/api.(*Config).BasicAuth.func1({0xc39e80, 0xc000458000}, 0xc00009ce00) github.com/bolkedebruin/rdpgw/cmd/rdpgw/api/basic.go:52 +0x59b net/http.HandlerFunc.ServeHTTP(0xc3a858?, {0xc39e80?, 0xc000458000?}, 0xc32e00?) net/http/server.go:2109 +0x2f github.com/bolkedebruin/rdpgw/cmd/rdpgw/common.EnrichContext.func1({0xc39e80, 0xc000458000}, 0xc00009cc00) github.com/bolkedebruin/rdpgw/cmd/rdpgw/common/remote.go:41 +0x282 net/http.HandlerFunc.ServeHTTP(0xc00001baf0?, {0xc39e80?, 0xc000458000?}, 0x0?) net/http/server.go:2109 +0x2f net/http.(*ServeMux).ServeHTTP(0xc00013687d?, {0xc39e80, 0xc000458000}, 0xc00009cc00) net/http/server.go:2487 +0x149 net/http.serverHandler.ServeHTTP({0xc0000a0570?}, {0xc39e80, 0xc000458000}, 0xc00009cc00) net/http/server.go:2947 +0x30c net/http.(*conn).serve(0xc000000280, {0xc3a858, 0xc0002477a0}) net/http/server.go:1991 +0x607 created by net/http.(*Server).Serve net/http/server.go:3102 +0x4db Problem maked patch: https://github.com/bolkedebruin/rdpgw/commit/f94e73b1ecd674771f1e1f4ea4417ae138f76934

Im try modify old source code manual adding modification. Compoile work not problem. Try runing new binary replaced error massage.

Thanks your wok and help!

bolkedebruin commented 1 year ago

If you have authentication = local you should not use your browser to establish a connection (i.e. through https://xxx/connect). In this case you can use your RDP client directly.

I've just updated the code to disable the connect endpoint if local auth is used.