Skip to content

Commit

Permalink
Add DebugTLSHandshake option
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jul 17, 2024
1 parent 2825273 commit 1de226e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type Configuration struct {
MaxTLSVersion string `json:"maxTLSVersion"` // maximum TLS version
CipherSuites string `json:"cipher_suites"` // use custom CipherSuites
InsecureSkipVerify bool `json:"insecureSkipVerify"` // tls configuration option
DebugTLSHandshake bool `json:"debugTLSHandshake"` // enable TLS handshake debug info on stdout

KeepAlive bool `json:"keepAlive"` // keep alive for http proxy transport
KeepAliveTimeout int `json:"keepAliveTimeout"` // keep alive timeout
Expand Down
4 changes: 4 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ func getServer(serverCrt, serverKey string, customVerify bool) (*http.Server, er
VerifyPeerCertificate: VerifyPeerCertificate,
}
}
// enable debugging of TLS handshake
if Config.DebugTLSHandshake {
tlsConfig.KeyLogWriter = os.Stdout
}
// set min/max TLS version only if they are provided in configuration
if Config.MinTLSVersion != "" {
log.Println("use minTLSVersion", minVer)
Expand Down

0 comments on commit 1de226e

Please sign in to comment.