User Agent do not contain bridge version, only client in format

This commit is contained in:
Michal Horejsek
2020-04-27 14:28:40 +02:00
committed by James Houlahan
parent 1d49a484a8
commit 984b28e8f9
23 changed files with 125 additions and 74 deletions

View File

@ -39,6 +39,9 @@ type PinningTLSDialer struct {
// appVersion is needed to report TLS mismatches.
appVersion string
// userAgent is needed to report TLS mismatches.
userAgent string
// enableRemoteReporting instructs the dialer to report TLS mismatches.
enableRemoteReporting bool
@ -61,9 +64,10 @@ func (p *PinningTLSDialer) SetTLSIssueNotifier(notifier func()) {
p.tlsIssueNotifier = notifier
}
func (p *PinningTLSDialer) EnableRemoteTLSIssueReporting(appVersion string) {
func (p *PinningTLSDialer) EnableRemoteTLSIssueReporting(appVersion, userAgent string) {
p.enableRemoteReporting = true
p.appVersion = appVersion
p.userAgent = userAgent
}
// DialTLS dials the given network/address, returning an error if the certificates don't match the trusted pins.
@ -89,6 +93,7 @@ func (p *PinningTLSDialer) DialTLS(network, address string) (conn net.Conn, err
time.Now().Format(time.RFC3339),
tlsConn.ConnectionState(),
p.appVersion,
p.userAgent,
)
}