• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ooni / netem / 6095017614 / 1
83%
main: 84%

Build:
Build:
LAST BUILD BRANCH: debug/dpi
DEFAULT BRANCH: main
Ran 06 Sep 2023 09:07AM UTC
Files 30
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Sep 2023 09:04AM UTC coverage: 82.893% (-0.2%) from 83.112%
6095017614.1

Pull #37

github

bassosimone
feat: fork google/martian/v3/mitm to build expired certs

To move forward with https://github.com/ooni/probe/issues/1803, I want to
generate expired certificates. To this end, I have forked the mitm package
to peek into internals and further customize certificate generation.

I forked at https://github.com/google/martian/commit/19163e1b8.

The diff between the original code and my code is the following:

```diff
--- mitmx/mitm.go.orig	2023-09-06 10:42:30
+++ mitmx/mitmx.go	2023-09-06 10:46:28
@@ -12,10 +12,12 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.

-// Package mitm provides tooling for MITMing TLS connections. It provides
+// Package mitmx provides tooling for MITMing TLS connections. It provides
 // tooling to create CA certs and generate TLS configs that can be used to MITM
 // a TLS connection with a provided CA certificate.
-package mitm
+//
+// This package is a fork of the mitm package in github.com/google/martian/v3.
+package mitmx

 import (
 	"bytes"
@@ -51,7 +53,6 @@
 	validity               time.Duration
 	org                    string
 	h2Config               *h2.Config
-	getCertificate         func(*tls.ClientHelloInfo) (*tls.Certificate, error)
 	roots                  *x509.CertPool
 	skipVerify             bool
 	handshakeErrorCallback func(*http.Request, error)
@@ -63,6 +64,12 @@
 // NewAuthority creates a new CA certificate and associated
 // private key.
 func NewAuthority(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error) {
+	return NewAuthorityWithTimeNow(name, organization, validity, time.Now)
+}
+
+// NewAuthorityWithTimeNow is like NewAuthority but allows to customize the time.Now func
+func NewAuthorityWithTimeNow(
+	name, organization string, validity time.Duration, timeNow func() time.Time) (*x509.Certificate, *rsa.PrivateKey, error) {
 	priv, err := rsa.GenerateKey(rand.Reader, 20... (continued)
Pull Request #37: feat: fork google/martian/v3/mitm to build expired certs

2476 of 2987 relevant lines covered (82.89%)

0.88 hits per line

Source Files on job 0 - 6095017614.1
  • Tree
  • List 0
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6095017614
  • d65b71b5 on github
  • Prev Job for on issue/1803 (#6090868955.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc