rmetzler / symfony-cli

The Symfony CLI tool
https://symfony.com/download
GNU Affero General Public License v3.0
0 stars 0 forks source link

Crash of Proxy when use of self signed TLS on custom backend #2

Open Shanuson opened 18 hours ago

Shanuson commented 18 hours ago

When a symfony project is in running state, and the custom backend is using a self signed certificate and TLS connection the symfony cli crashes:

Log:

KMD HCF handling request for orf.wip KMD HCF projectDir /Users/kai-martindittkrist/workspace/orf/endava/tvthek KMD HCF check https Oct 1 13:45:28 |???? | [154] WARN: Cannot handshake target localhost tls: failed to verify certificate: x509: certificate signed by unknown authority panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x1044294b0]

goroutine 20371 [running]: bufio.(Reader).fill(0x140004ce4e0) /opt/homebrew/Cellar/go/1.22.4/libexec/src/bufio/bufio.go:110 +0xd0 bufio.(Reader).ReadSlice(0x140004ce4e0, 0xa) /opt/homebrew/Cellar/go/1.22.4/libexec/src/bufio/bufio.go:376 +0x30 bufio.(Reader).ReadLine(0x140004ce4e0) /opt/homebrew/Cellar/go/1.22.4/libexec/src/bufio/bufio.go:405 +0x24 net/textproto.(Reader).readLineSlice(0x14000509eb8, 0xffffffffffffffff) /opt/homebrew/Cellar/go/1.22.4/libexec/src/net/textproto/reader.go:63 +0x84 net/textproto.(*Reader).ReadLine(...) /opt/homebrew/Cellar/go/1.22.4/libexec/src/net/textproto/reader.go:43 net/http.ReadResponse(0x140004ce4e0, 0x140002de240) /opt/homebrew/Cellar/go/1.22.4/libexec/src/net/http/response.go:161 +0x7c github.com/symfony-cli/symfony-cli/local/proxy.tlsToLocalWebServer.func4.2() /Users/kai-martindittkrist/workspace/own/symfony-cli/local/proxy/proxy.go:314 +0x5c created by github.com/symfony-cli/symfony-cli/local/proxy.tlsToLocalWebServer.func4 in goroutine 20318 /Users/kai-martindittkrist/workspace/own/symfony-cli/local/proxy/proxy.go:312 +0x10ec

How to reproduce:

Futher information: The backend can be reached successfully if no symfony backend is running.

Shanuson commented 18 hours ago

Line with the error:

resp, err := http.ReadResponse(remoteBuf.Reader, myReq.Request)