Skip to content

Commit

Permalink
Use same Subject of CA as the MITM certificate Subject
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPelli authored and elazarl committed Dec 9, 2024
1 parent 47dbfa5 commit 60626ae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"crypto/sha1"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"fmt"
"math/big"
"math/rand"
Expand Down Expand Up @@ -54,11 +53,9 @@ func signHost(ca tls.Certificate, hosts []string) (cert *tls.Certificate, err er
// TODO(elazar): instead of this ugly hack, just encode the certificate and hash the binary form.
SerialNumber: serial,
Issuer: x509ca.Subject,
Subject: pkix.Name{
Organization: []string{"GoProxy untrusted MITM proxy Inc"},
},
NotBefore: start,
NotAfter: end,
Subject: x509ca.Subject,
NotBefore: start,
NotAfter: end,

KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
Expand Down

0 comments on commit 60626ae

Please sign in to comment.