core: do not log TLS handshake errors by default, option to enable (#1652)
* core: do not log TLS handshake errors by default, option to enable * update simplexmq
This commit is contained in:
committed by
GitHub
parent
90a20cd52f
commit
13090ff6ed
@@ -84,6 +84,11 @@ chatOpts appDir defaultDbFileName = do
|
||||
<> help "TCP timeout, seconds (default: 5/10 without/with SOCKS5 proxy)"
|
||||
<> value 0
|
||||
)
|
||||
logTLSErrors <-
|
||||
switch
|
||||
( long "log-tls-errors"
|
||||
<> help "Log TLS errors"
|
||||
)
|
||||
logConnections <-
|
||||
switch
|
||||
( long "connections"
|
||||
@@ -152,7 +157,7 @@ chatOpts appDir defaultDbFileName = do
|
||||
{ dbFilePrefix,
|
||||
dbKey,
|
||||
smpServers,
|
||||
networkConfig = fullNetworkConfig socksProxy $ useTcpTimeout socksProxy t,
|
||||
networkConfig = fullNetworkConfig socksProxy (useTcpTimeout socksProxy t) logTLSErrors,
|
||||
logConnections,
|
||||
logServerHosts,
|
||||
logAgent,
|
||||
@@ -167,10 +172,10 @@ chatOpts appDir defaultDbFileName = do
|
||||
useTcpTimeout p t = 1000000 * if t > 0 then t else maybe 5 (const 10) p
|
||||
defaultDbFilePath = combine appDir defaultDbFileName
|
||||
|
||||
fullNetworkConfig :: Maybe SocksProxy -> Int -> NetworkConfig
|
||||
fullNetworkConfig socksProxy tcpTimeout =
|
||||
fullNetworkConfig :: Maybe SocksProxy -> Int -> Bool -> NetworkConfig
|
||||
fullNetworkConfig socksProxy tcpTimeout logTLSErrors =
|
||||
let tcpConnectTimeout = (tcpTimeout * 3) `div` 2
|
||||
in defaultNetworkConfig {socksProxy, tcpTimeout, tcpConnectTimeout}
|
||||
in defaultNetworkConfig {socksProxy, tcpTimeout, tcpConnectTimeout, logTLSErrors}
|
||||
|
||||
parseSMPServers :: ReadM [SMPServerWithAuth]
|
||||
parseSMPServers = eitherReader $ parseAll smpServersP . B.pack
|
||||
|
||||
Reference in New Issue
Block a user