Skip to content

Commit

Permalink
fix(UNetStack): expose the TLSMITMConfig
Browse files Browse the repository at this point in the history
Also part of ooni/probe#1803
  • Loading branch information
bassosimone committed Sep 6, 2023
1 parent c91fe50 commit 85d9625
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tlsmitm_test.go
Expand Up @@ -48,7 +48,7 @@ func TestMITMWeCanGenerateAnExpiredCertificate(t *testing.T) {
defer tcpConn.Close()

tlsClientConfig := &tls.Config{
RootCAs: Must1(topology.TLSMITMConfig().CertPool()),
RootCAs: Must1(clientStack.TLSMITMConfig().CertPool()),
ServerName: "www.example.com",
}
tlsConn := tls.Client(tcpConn, tlsClientConfig)
Expand Down
7 changes: 6 additions & 1 deletion unetstack.go
Expand Up @@ -104,7 +104,12 @@ func NewUNetStack(
return stack, nil
}

// Logger implements HTTPUnderlyingNetwork
// TLSMITMConfig exposes the underlying [TLSMITMConfig].
func (gs *UNetStack) TLSMITMConfig() *TLSMITMConfig {
return gs.mitmConfig
}

// Logger implements HTTPUnderlyingNetwork.
func (gs *UNetStack) Logger() Logger {
return gs.ns.logger
}
Expand Down

0 comments on commit 85d9625

Please sign in to comment.