mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
Remove TLS EOF errors from logs (#16930)
Signed-off-by: Manuel de Brito Fontes <aledbf@gmail.com>
This commit is contained in:
parent
b1ab625626
commit
aa61917989
@ -5,16 +5,18 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
stdlog "log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/gitpod-io/golang-crypto/ssh"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/klauspost/cpuid/v2"
|
"github.com/klauspost/cpuid/v2"
|
||||||
|
|
||||||
"github.com/gitpod-io/gitpod/common-go/log"
|
"github.com/gitpod-io/gitpod/common-go/log"
|
||||||
|
"github.com/gitpod-io/golang-crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WorkspaceProxy is the entity which forwards all inbound requests to the relevant workspace pods.
|
// WorkspaceProxy is the entity which forwards all inbound requests to the relevant workspace pods.
|
||||||
@ -64,6 +66,7 @@ func (p *WorkspaceProxy) MustServe() {
|
|||||||
PreferServerCipherSuites: true,
|
PreferServerCipherSuites: true,
|
||||||
NextProtos: []string{"h2", "http/1.1"},
|
NextProtos: []string{"h2", "http/1.1"},
|
||||||
},
|
},
|
||||||
|
ErrorLog: stdlog.New(logrusErrorWriter{}, "", 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -141,3 +144,16 @@ func optimalDefaultCipherSuites() []uint16 {
|
|||||||
}
|
}
|
||||||
return defaultCipherSuitesWithoutAESNI
|
return defaultCipherSuitesWithoutAESNI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tlsHandshakeErrorPrefix = []byte("http: TLS handshake error")
|
||||||
|
|
||||||
|
type logrusErrorWriter struct{}
|
||||||
|
|
||||||
|
func (w logrusErrorWriter) Write(p []byte) (int, error) {
|
||||||
|
if bytes.Contains(p, tlsHandshakeErrorPrefix) {
|
||||||
|
return len(p), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Errorf("%s", string(p))
|
||||||
|
return len(p), nil
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user