mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Add DTLS KeyLog configuration option in WebRTC API
Add an option in the setting engine to log TLS key material when a DTLS connection is established with a peer. The option exists in pion/dtls but is not easily accessible
This commit is contained in:

committed by
Eric Daniels

parent
457ff6cb73
commit
448f4ba601
@@ -71,6 +71,7 @@ type SettingEngine struct {
|
||||
clientAuth *dtls.ClientAuthType
|
||||
clientCAs *x509.CertPool
|
||||
rootCAs *x509.CertPool
|
||||
keyLogWriter io.Writer
|
||||
}
|
||||
sctp struct {
|
||||
maxReceiveBufferSize uint32
|
||||
@@ -422,6 +423,12 @@ func (e *SettingEngine) SetDTLSRootCAs(rootCAs *x509.CertPool) {
|
||||
e.dtls.rootCAs = rootCAs
|
||||
}
|
||||
|
||||
// SetDTLSKeyLogWriter sets the destination of the TLS key material for debugging.
|
||||
// Logging key material compromises security and should only be use for debugging.
|
||||
func (e *SettingEngine) SetDTLSKeyLogWriter(writer io.Writer) {
|
||||
e.dtls.keyLogWriter = writer
|
||||
}
|
||||
|
||||
// SetSCTPMaxReceiveBufferSize sets the maximum receive buffer size.
|
||||
// Leave this 0 for the default maxReceiveBufferSize.
|
||||
func (e *SettingEngine) SetSCTPMaxReceiveBufferSize(maxReceiveBufferSize uint32) {
|
||||
|
Reference in New Issue
Block a user