docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
func storeEnabled(name string) bool {
stores := os.Getenv("TRUST_STORES")
if stores == "" {
return true
}
for _, store := range strings.Split(stores, ",") {
if store == name {
return true
}
}
return false
}
| <mask> }
<mask>
<mask> func fatalIfErr(err error, msg string) {
<mask> if err != nil {
<mask> log.Fatalf("ERROR: %s: %s", msg, err)
<mask> }
<mask> }
</s> Add the TRUST_STORES environment variable
Fixes #95 | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/592400aab064e9c4e2bd9975bfe56343804aec17 | main.go |
"crypto"
"crypto/ecdsa"
"crypto/elliptic" | <mask>
<mask> import (
<mask> "crypto/rand"
<mask> "crypto/rsa"
<mask> "crypto/sha1"
<mask> "crypto/x509"
<mask> "crypto/x509/pkix"
<mask> "encoding/asn1"
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pkcs12 bool
</s> add pkcs12, ecdsa bool </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag,
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
priv, err := m.generateKey(false) | <mask> if m.caKey == nil {
<mask> log.Fatalln("ERROR: can't create new certificates because the CA key (rootCA-key.pem) is missing")
<mask> }
<mask>
<mask> priv, err := rsa.GenerateKey(rand.Reader, 2048)
<mask> fatalIfErr(err, "failed to generate certificate key")
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
pub := priv.(crypto.Signer).Public() | <mask> priv, err := m.generateKey(false)
<mask> fatalIfErr(err, "failed to generate certificate key")
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) | <mask> if m.pkcs12 {
<mask> tpl.Subject.CommonName = hosts[0]
<mask> }
<mask>
<mask> pub := priv.PublicKey
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
<mask> fatalIfErr(err, "failed to generate certificate")
<mask>
<mask> certFile, keyFile, p12File := m.fileNames(hosts)
<mask>
<mask> if !m.pkcs12 {
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
priv, err := m.generateKey(true) | <mask> fatalIfErr(err, "failed to parse the CA key")
<mask> }
<mask>
<mask> func (m *mkcert) newCA() {
<mask> priv, err := rsa.GenerateKey(rand.Reader, 3072)
<mask> fatalIfErr(err, "failed to generate the CA key")
<mask> pub := priv.PublicKey
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
pub := priv.(crypto.Signer).Public() | <mask>
<mask> func (m *mkcert) newCA() {
<mask> priv, err := rsa.GenerateKey(rand.Reader, 3072)
<mask> fatalIfErr(err, "failed to generate the CA key")
<mask> pub := priv.PublicKey
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
<mask>
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
spkiASN1, err := x509.MarshalPKIXPublicKey(pub) | <mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
<mask>
<mask> spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
<mask> fatalIfErr(err, "failed to encode public key")
<mask>
<mask> var spki struct {
<mask> Algorithm pkix.AlgorithmIdentifier
<mask> SubjectPublicKey asn1.BitString
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) | <mask> IsCA: true,
<mask> MaxPathLenZero: true,
<mask> }
<mask>
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
<mask> fatalIfErr(err, "failed to generate CA certificate")
<mask>
<mask> privDER, err := x509.MarshalPKCS8PrivateKey(priv)
<mask> fatalIfErr(err, "failed to encode CA key")
<mask> err = ioutil.WriteFile(filepath.Join(m.CAROOT, rootKeyName), pem.EncodeToMemory(
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | cert.go |
-ecdsa
Generate a certificate with an ECDSA key.
| <mask> -cert-file FILE, -key-file FILE, -p12-file FILE
<mask> Customize the output paths.
<mask>
<mask> -pkcs12
<mask> Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
<mask> containing certificate and key for legacy applications.
<mask>
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag,
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | main.go |
ecdsaFlag = flag.Bool("ecdsa", false, "") | <mask> installFlag = flag.Bool("install", false, "")
<mask> uninstallFlag = flag.Bool("uninstall", false, "")
<mask> pkcs12Flag = flag.Bool("pkcs12", false, "")
<mask> helpFlag = flag.Bool("help", false, "")
<mask> carootFlag = flag.Bool("CAROOT", false, "")
<mask> certFileFlag = flag.String("cert-file", "", "")
<mask> keyFileFlag = flag.String("key-file", "", "")
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pkcs12 bool
</s> add pkcs12, ecdsa bool </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) </s> remove cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv) </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag,
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | main.go |
installMode: *installFlag, uninstallMode: *uninstallFlag,
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, | <mask> if *installFlag && *uninstallFlag {
<mask> log.Fatalln("ERROR: you can't set -install and -uninstall at the same time")
<mask> }
<mask> (&mkcert{
<mask> installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
<mask> certFile: *certFileFlag, keyFile: *keyFileFlag, p12File: *p12FileFlag,
<mask> }).Run(flag.Args())
<mask> }
<mask>
<mask> const rootName = "rootCA.pem"
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove priv, err := rsa.GenerateKey(rand.Reader, 2048)
</s> add priv, err := m.generateKey(false) </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) </s> remove pkcs12 bool
</s> add pkcs12, ecdsa bool </s> remove priv, err := rsa.GenerateKey(rand.Reader, 3072)
</s> add priv, err := m.generateKey(true) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | main.go |
pkcs12, ecdsa bool | <mask> const rootKeyName = "rootCA-key.pem"
<mask>
<mask> type mkcert struct {
<mask> installMode, uninstallMode bool
<mask> pkcs12 bool
<mask> keyFile, certFile, p12File string
<mask>
<mask> CAROOT string
<mask> caCert *x509.Certificate
<mask> caKey crypto.PrivateKey
</s> Add -ecdsa for generating certificates with ECDSA keys
Fixes #118 </s> remove pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
</s> add cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, pub, m.caKey) </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag,
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, </s> remove spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
</s> add spkiASN1, err := x509.MarshalPKIXPublicKey(pub) </s> remove pub := priv.PublicKey
</s> add pub := priv.(crypto.Signer).Public() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5bb0c47df70e943a463cfc0cbecff97c593c3f2d | main.go |
"errors" | <mask> "crypto/x509"
<mask> "crypto/x509/pkix"
<mask> "encoding/asn1"
<mask> "encoding/pem"
<mask> "io/ioutil"
<mask> "log"
<mask> "math/big"
<mask> "net"
<mask> "os"
<mask> "os/exec"
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | cert.go |
var keyname, certname, p12name string | <mask>
<mask> pub := priv.PublicKey
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
<mask> fatalIfErr(err, "failed to generate certificate")
<mask>
<mask> filename := strings.Replace(hosts[0], ":", "_", -1)
<mask> filename = strings.Replace(filename, "*", "_wildcard", -1)
<mask> if len(hosts) > 1 {
<mask> filename += "+" + strconv.Itoa(len(hosts)-1)
<mask> }
<mask>
<mask> if !m.pkcs12 {
<mask> privDER, err := x509.MarshalPKCS8PrivateKey(priv)
<mask> fatalIfErr(err, "failed to encode certificate key")
<mask> err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
<mask> &pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0600)
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | cert.go |
keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( | <mask>
<mask> if !m.pkcs12 {
<mask> privDER, err := x509.MarshalPKCS8PrivateKey(priv)
<mask> fatalIfErr(err, "failed to encode certificate key")
<mask> err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
<mask> &pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0600)
<mask> fatalIfErr(err, "failed to save certificate key")
<mask>
<mask> err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
<mask> &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( </s> remove
filename := strings.Replace(hosts[0], ":", "_", -1)
filename = strings.Replace(filename, "*", "_wildcard", -1)
if len(hosts) > 1 {
filename += "+" + strconv.Itoa(len(hosts)-1)
}
</s> add var keyname, certname, p12name string </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | cert.go |
certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( | <mask> err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
<mask> &pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0600)
<mask> fatalIfErr(err, "failed to save certificate key")
<mask>
<mask> err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
<mask> &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
<mask> fatalIfErr(err, "failed to save certificate key")
<mask> } else {
<mask> domainCert, _ := x509.ParseCertificate(cert)
<mask> pfxData, err := pkcs12.Encode(rand.Reader, priv, domainCert, []*x509.Certificate{m.caCert}, "changeit")
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( </s> remove
filename := strings.Replace(hosts[0], ":", "_", -1)
filename = strings.Replace(filename, "*", "_wildcard", -1)
if len(hosts) > 1 {
filename += "+" + strconv.Itoa(len(hosts)-1)
}
</s> add var keyname, certname, p12name string </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | cert.go |
// customize file name according to issue#72
var keyFileFlag = flag.String("key-file", "", "customlize your key file name")
var certFileFlag = flag.String("cert-file", "", "customlize your cert file name")
var p12FileFlag = flag.String("p12-file", "", "customlize your p12 file name") | <mask> var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
<mask> var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
<mask> flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
<mask> flag.Parse()
<mask> if *carootFlag {
<mask> if *installFlag || *uninstallFlag {
<mask> log.Fatalln("ERROR: you can't set -[un]install and -CAROOT at the same time")
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove
filename := strings.Replace(hosts[0], ":", "_", -1)
filename = strings.Replace(filename, "*", "_wildcard", -1)
if len(hosts) > 1 {
filename += "+" + strconv.Itoa(len(hosts)-1)
}
</s> add var keyname, certname, p12name string </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | main.go |
keyFileFlag: *keyFileFlag,
certFileFlag: *certFileFlag,
p12FileFlag: *p12FileFlag, | <mask> log.Fatalln("ERROR: you can't set -install and -uninstall at the same time")
<mask> }
<mask> (&mkcert{
<mask> installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
<mask> }).Run(flag.Args())
<mask> }
<mask>
<mask> const rootName = "rootCA.pem"
<mask> const keyName = "rootCA-key.pem"
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove installMode, uninstallMode bool
pkcs12 bool
</s> add installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( </s> remove
filename := strings.Replace(hosts[0], ":", "_", -1)
filename = strings.Replace(filename, "*", "_wildcard", -1)
if len(hosts) > 1 {
filename += "+" + strconv.Itoa(len(hosts)-1)
}
</s> add var keyname, certname, p12name string </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | main.go |
installMode, uninstallMode bool
pkcs12 bool
keyFileFlag, certFileFlag, p12FileFlag string | <mask> const rootName = "rootCA.pem"
<mask> const keyName = "rootCA-key.pem"
<mask>
<mask> type mkcert struct {
<mask> installMode, uninstallMode bool
<mask> pkcs12 bool
<mask>
<mask> CAROOT string
<mask> caCert *x509.Certificate
<mask> caKey crypto.PrivateKey
<mask>
</s> Add -cert-file, -key-file and -p12-file (#77) </s> remove
filename := strings.Replace(hosts[0], ":", "_", -1)
filename = strings.Replace(filename, "*", "_wildcard", -1)
if len(hosts) > 1 {
filename += "+" + strconv.Itoa(len(hosts)-1)
}
</s> add var keyname, certname, p12name string </s> remove err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory(
</s> add keyname, err = m.getFileName("key", hosts)
fatalIfErr(err, "failed to generate key file name")
err = ioutil.WriteFile(keyname, pem.EncodeToMemory( </s> remove err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(
</s> add certname, err = m.getFileName("cert", hosts)
fatalIfErr(err, "failed to generate cert file name")
err = ioutil.WriteFile(certname, pem.EncodeToMemory( | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5ea72c377dae5266b6a2c2cc4f173edcd2a59347 | main.go |
if err == nil { | <mask> )
<mask>
<mask> func init() {
<mask> _, err := os.Stat("/etc/pki/ca-trust/source/anchors/")
<mask> if !os.IsNotExist(err) {
<mask> SystemTrustFilename = "/etc/pki/ca-trust/source/anchors/mkcert-rootCA.pem"
<mask> SystemTrustCommand = []string{"update-ca-trust", "extract"}
<mask> } else {
<mask> _, err = os.Stat("/usr/local/share/ca-certificates/")
<mask> if !os.IsNotExist(err) {
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert8.db")); err == nil { </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_linux.go |
if err == nil { | <mask> SystemTrustFilename = "/etc/pki/ca-trust/source/anchors/mkcert-rootCA.pem"
<mask> SystemTrustCommand = []string{"update-ca-trust", "extract"}
<mask> } else {
<mask> _, err = os.Stat("/usr/local/share/ca-certificates/")
<mask> if !os.IsNotExist(err) {
<mask> SystemTrustFilename = "/usr/local/share/ca-certificates/mkcert-rootCA.crt"
<mask> SystemTrustCommand = []string{"update-ca-certificates"}
<mask> }
<mask> }
<mask> if SystemTrustCommand != nil {
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil </s> remove hasCertutil = !os.IsNotExist(err)
</s> add hasCertutil = err == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_linux.go |
hasNSS = hasNSS || err == nil | <mask> "/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
<mask> "/Applications/Firefox Developer Edition.app",
<mask> } {
<mask> _, err := os.Stat(path)
<mask> hasNSS = hasNSS || !os.IsNotExist(err)
<mask> }
<mask>
<mask> switch runtime.GOOS {
<mask> case "darwin":
<mask> out, err := exec.Command("brew", "--prefix", "nss").Output()
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert8.db")); err == nil { </s> remove hasCertutil = !os.IsNotExist(err)
</s> add hasCertutil = err == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_nss.go |
hasCertutil = err == nil | <mask> }
<mask> certutilPath = filepath.Join(strings.TrimSpace(string(out)), "bin", "certutil")
<mask>
<mask> _, err = os.Stat(certutilPath)
<mask> hasCertutil = !os.IsNotExist(err)
<mask>
<mask> case "linux":
<mask> var err error
<mask> certutilPath, err = exec.LookPath("certutil")
<mask> hasCertutil = err == nil
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_nss.go |
if _, err := os.Stat(nssDB); err == nil { | <mask> }
<mask>
<mask> func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
<mask> profiles, _ := filepath.Glob(FirefoxProfile)
<mask> if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
<mask> profiles = append(profiles, nssDB)
<mask> }
<mask> if len(profiles) == 0 {
<mask> return
<mask> }
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert8.db")); err == nil { </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_nss.go |
if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { | <mask> for _, profile := range profiles {
<mask> if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
<mask> continue
<mask> }
<mask> if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
<mask> f("sql:" + profile)
<mask> found++
<mask> continue
<mask> }
<mask> if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert8.db")); err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_nss.go |
if _, err := os.Stat(filepath.Join(profile, "cert8.db")); err == nil { | <mask> f("sql:" + profile)
<mask> found++
<mask> continue
<mask> }
<mask> if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
<mask> f("dbm:" + profile)
<mask> found++
<mask> }
<mask> }
<mask> return
</s> Replace !os.IsNotExist with == nil
!os.IsNotExist would also be true for other errors which don't mean the
file exists. </s> remove if _, err := os.Stat(filepath.Join(profile, "cert9.db")); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(filepath.Join(profile, "cert9.db")); err == nil { </s> remove if _, err := os.Stat(nssDB); !os.IsNotExist(err) {
</s> add if _, err := os.Stat(nssDB); err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove if !os.IsNotExist(err) {
</s> add if err == nil { </s> remove hasNSS = hasNSS || !os.IsNotExist(err)
</s> add hasNSS = hasNSS || err == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/5fc72d92bc6b3f2713da399289655c1c8236b611 | truststore_nss.go |
<mask> "github.com/DHowett/go-plist"
<mask> )
<mask>
<mask> var (
<mask> FirefoxPath = "/Applications/Firefox.app"
<mask> FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
<mask> CertutilInstallHelp = "brew install nss"
<mask> NSSBrowsers = "Firefox"
<mask> )
<mask>
</s> Add support for Firefox Developer Edition
This also fixes a bug where we wouldn't install to Chrome on Linux if
Firefox wasn't also present.
Closes #48
Updates #51 </s> remove FirefoxPath = "/usr/bin/firefox"
</s> add </s> remove _, err := os.Stat(nssDB)
hasNSS = hasNSS && !os.IsNotExist(err)
</s> add var err error </s> remove _, err := os.Stat(FirefoxPath)
hasNSS = !os.IsNotExist(err)
</s> add for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
"/Applications/Firefox Developer Edition.app",
} {
_, err := os.Stat(path)
hasNSS = hasNSS || !os.IsNotExist(err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/61180c71ad97395b97b0a54a0d90df81206fc9c4 | truststore_darwin.go | |
<mask> "strings"
<mask> )
<mask>
<mask> var (
<mask> FirefoxPath = "/usr/bin/firefox"
<mask> FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
<mask> CertutilInstallHelp = `apt install libnss3-tools" or "yum install nss-tools`
<mask> NSSBrowsers = "Firefox and/or Chrome/Chromium"
<mask>
<mask> SystemTrustFilename string
</s> Add support for Firefox Developer Edition
This also fixes a bug where we wouldn't install to Chrome on Linux if
Firefox wasn't also present.
Closes #48
Updates #51 </s> remove FirefoxPath = "/Applications/Firefox.app"
</s> add </s> remove _, err := os.Stat(nssDB)
hasNSS = hasNSS && !os.IsNotExist(err)
</s> add var err error </s> remove _, err := os.Stat(FirefoxPath)
hasNSS = !os.IsNotExist(err)
</s> add for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
"/Applications/Firefox Developer Edition.app",
} {
_, err := os.Stat(path)
hasNSS = hasNSS || !os.IsNotExist(err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/61180c71ad97395b97b0a54a0d90df81206fc9c4 | truststore_linux.go | |
for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
"/Applications/Firefox Developer Edition.app",
} {
_, err := os.Stat(path)
hasNSS = hasNSS || !os.IsNotExist(err)
} | <mask> nssDB = filepath.Join(os.Getenv("HOME"), ".pki/nssdb")
<mask> )
<mask>
<mask> func init() {
<mask> _, err := os.Stat(FirefoxPath)
<mask> hasNSS = !os.IsNotExist(err)
<mask>
<mask> switch runtime.GOOS {
<mask> case "darwin":
<mask> out, err := exec.Command("brew", "--prefix", "nss").Output()
<mask> if err != nil {
</s> Add support for Firefox Developer Edition
This also fixes a bug where we wouldn't install to Chrome on Linux if
Firefox wasn't also present.
Closes #48
Updates #51 </s> remove FirefoxPath = "/Applications/Firefox.app"
</s> add </s> remove FirefoxPath = "/usr/bin/firefox"
</s> add </s> remove _, err := os.Stat(nssDB)
hasNSS = hasNSS && !os.IsNotExist(err)
</s> add var err error | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/61180c71ad97395b97b0a54a0d90df81206fc9c4 | truststore_nss.go |
var err error | <mask> _, err = os.Stat(certutilPath)
<mask> hasCertutil = !os.IsNotExist(err)
<mask>
<mask> case "linux":
<mask> _, err := os.Stat(nssDB)
<mask> hasNSS = hasNSS && !os.IsNotExist(err)
<mask>
<mask> certutilPath, err = exec.LookPath("certutil")
<mask> hasCertutil = err == nil
<mask> }
<mask> }
<mask>
</s> Add support for Firefox Developer Edition
This also fixes a bug where we wouldn't install to Chrome on Linux if
Firefox wasn't also present.
Closes #48
Updates #51 </s> remove FirefoxPath = "/Applications/Firefox.app"
</s> add </s> remove FirefoxPath = "/usr/bin/firefox"
</s> add </s> remove _, err := os.Stat(FirefoxPath)
hasNSS = !os.IsNotExist(err)
</s> add for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
"/Applications/Firefox Developer Edition.app",
} {
_, err := os.Stat(path)
hasNSS = hasNSS || !os.IsNotExist(err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/61180c71ad97395b97b0a54a0d90df81206fc9c4 | truststore_nss.go |
<mask> module github.com/FiloSottile/mkcert
<mask>
<mask> require (
<mask> github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
<mask> golang.org/x/text v0.3.0 // indirect
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237
<mask> )
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
</s> add github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= </s> remove "github.com/DHowett/go-plist"
</s> add "howett.net/plist" | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | go.mod | |
howett.net/plist v0.0.0-20181124034731-591f970eefbb | <mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
<mask> golang.org/x/text v0.3.0 // indirect
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237
<mask> )
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
</s> add github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add | [
"keep",
"add",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | go.mod |
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | <mask> github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
<mask> github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237 h1:iAEkCBPbRaflBgZ7o9gjVUuWuvWeV4sytFWg9o+Pj2k=
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add | [
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | go.sum |
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= | <mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237 h1:iAEkCBPbRaflBgZ7o9gjVUuWuvWeV4sytFWg9o+Pj2k=
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237/go.mod h1:/xvNRWUqm0+/ZMiF4EX00vrSCMsE4/NHb+Pt3freEeQ=
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
</s> add github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | go.sum |
"howett.net/plist" | <mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask>
<mask> "github.com/DHowett/go-plist"
<mask> )
<mask>
<mask> var (
<mask> FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
<mask> CertutilInstallHelp = "brew install nss"
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | truststore_darwin.go |
<mask> # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
<mask> github.com/DHowett/go-plist
<mask> # golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
<mask> golang.org/x/net/idna
<mask> # golang.org/x/text v0.3.0
<mask> golang.org/x/text/secure/bidirule
<mask> golang.org/x/text/unicode/bidi
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
</s> add github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | [
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | vendor/modules.txt | |
# howett.net/plist v0.0.0-20181124034731-591f970eefbb
howett.net/plist | <mask> golang.org/x/text/secure/bidirule
<mask> golang.org/x/text/unicode/bidi
<mask> golang.org/x/text/unicode/norm
<mask> golang.org/x/text/transform
<mask> # software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237
<mask> software.sslmate.com/src/go-pkcs12
<mask> software.sslmate.com/src/go-pkcs12/internal/rc2
</s> Import howett.net/plist by its correct name
Also bumping the version to one with a go.mod. </s> remove # github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
github.com/DHowett/go-plist
</s> add </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
</s> add </s> remove github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b h1:WFNhl1+1ofCWWdNFEhut77cmuMXjJYYvkEVloDdaUCI=
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b/go.mod h1:5paT5ZDrOm8eAJPem2Bd+q3FTi3Gxm/U4tb2tH8YIUQ=
</s> add github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/72ec55f07fe0412aafc8a5617d43b7a27c0ab68c | vendor/modules.txt |
if m.caKey == nil {
log.Fatalln("ERROR: can't create new certificates because the CA key (rootCA-key.pem) is missing")
}
| <mask>
<mask> func (m *mkcert) makeCert(hosts []string) {
<mask> priv, err := rsa.GenerateKey(rand.Reader, 2048)
<mask> fatalIfErr(err, "failed to generate certificate key")
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
</s> Add keyless install only mode </s> remove /*
priv, err := rsa.GenerateKey(rand.Reader, 2048)
fatalIfErr(err, "failed to generate the test key")
tpl := &x509.Certificate{
SerialNumber: big.NewInt(42),
DNSNames: []string{"test.mkcert.invalid"},
NotAfter: time.Now().AddDate(0, 0, 1),
NotBefore: time.Now().AddDate(0, 0, -1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
fatalIfErr(err, "failed to generate test certificate")
c, err := x509.ParseCertificate(cert)
fatalIfErr(err, "failed to parse test certificate")
*/
</s> add </s> remove keyPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, keyName))
fatalIfErr(err, "failed to read the CA key")
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/7433af8d0b44994260795a8fdbeeab49a03219b8 | main.go |
<mask> }
<mask>
<mask> certPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, rootName))
<mask> fatalIfErr(err, "failed to read the CA certificate")
<mask> keyPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, keyName))
<mask> fatalIfErr(err, "failed to read the CA key")
<mask>
<mask> certDERBlock, _ := pem.Decode(certPEMBlock)
<mask> if certDERBlock == nil || certDERBlock.Type != "CERTIFICATE" {
<mask> log.Fatalln("ERROR: failed to read the CA certificate: unexpected content")
<mask> }
<mask> m.caCert, err = x509.ParseCertificate(certDERBlock.Bytes)
</s> Add keyless install only mode </s> remove /*
priv, err := rsa.GenerateKey(rand.Reader, 2048)
fatalIfErr(err, "failed to generate the test key")
tpl := &x509.Certificate{
SerialNumber: big.NewInt(42),
DNSNames: []string{"test.mkcert.invalid"},
NotAfter: time.Now().AddDate(0, 0, 1),
NotBefore: time.Now().AddDate(0, 0, -1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
fatalIfErr(err, "failed to generate test certificate")
c, err := x509.ParseCertificate(cert)
fatalIfErr(err, "failed to parse test certificate")
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/7433af8d0b44994260795a8fdbeeab49a03219b8 | main.go | |
if _, err := os.Stat(filepath.Join(m.CAROOT, keyName)); os.IsNotExist(err) {
return // keyless mode, where only -install works
}
keyPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, keyName))
fatalIfErr(err, "failed to read the CA key") | <mask> }
<mask> m.caCert, err = x509.ParseCertificate(certDERBlock.Bytes)
<mask> fatalIfErr(err, "failed to parse the CA certificate")
<mask>
<mask> keyDERBlock, _ := pem.Decode(keyPEMBlock)
<mask> if keyDERBlock == nil || keyDERBlock.Type != "PRIVATE KEY" {
<mask> log.Fatalln("ERROR: failed to read the CA key: unexpected content")
<mask> }
</s> Add keyless install only mode </s> remove keyPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, keyName))
fatalIfErr(err, "failed to read the CA key")
</s> add </s> remove /*
priv, err := rsa.GenerateKey(rand.Reader, 2048)
fatalIfErr(err, "failed to generate the test key")
tpl := &x509.Certificate{
SerialNumber: big.NewInt(42),
DNSNames: []string{"test.mkcert.invalid"},
NotAfter: time.Now().AddDate(0, 0, 1),
NotBefore: time.Now().AddDate(0, 0, -1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
pub := priv.PublicKey
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
fatalIfErr(err, "failed to generate test certificate")
c, err := x509.ParseCertificate(cert)
fatalIfErr(err, "failed to parse test certificate")
*/
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/7433af8d0b44994260795a8fdbeeab49a03219b8 | main.go |
<mask> if m.ignoreCheckFailure {
<mask> return true
<mask> }
<mask>
<mask> /*
<mask> priv, err := rsa.GenerateKey(rand.Reader, 2048)
<mask> fatalIfErr(err, "failed to generate the test key")
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: big.NewInt(42),
<mask> DNSNames: []string{"test.mkcert.invalid"},
<mask>
<mask> NotAfter: time.Now().AddDate(0, 0, 1),
<mask> NotBefore: time.Now().AddDate(0, 0, -1),
<mask>
<mask> KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
<mask> ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
<mask> BasicConstraintsValid: true,
<mask> }
<mask>
<mask> pub := priv.PublicKey
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
<mask> fatalIfErr(err, "failed to generate test certificate")
<mask>
<mask> c, err := x509.ParseCertificate(cert)
<mask> fatalIfErr(err, "failed to parse test certificate")
<mask> */
<mask>
<mask> _, err := m.caCert.Verify(x509.VerifyOptions{})
<mask> return err == nil
<mask> }
<mask>
<mask> func fatalIfErr(err error, msg string) {
</s> Add keyless install only mode </s> remove keyPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, keyName))
fatalIfErr(err, "failed to read the CA key")
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/FiloSottile/mkcert/commit/7433af8d0b44994260795a8fdbeeab49a03219b8 | main.go | |
// Copyright 2018 The mkcert Authors. All rights reserved. | <mask> // Copyright 2018 The Go Authors. All rights reserved.
<mask> // Use of this source code is governed by a BSD-style
<mask> // license that can be found in the LICENSE file.
<mask>
<mask> package main
<mask>
</s> Fix and add missing license headers </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/74ab68812eefef257330c0650859e618766d04c3 | cert.go |
// Copyright 2018 The mkcert Authors. All rights reserved. | <mask> // Copyright 2018 The Go Authors. All rights reserved.
<mask> // Use of this source code is governed by a BSD-style
<mask> // license that can be found in the LICENSE file.
<mask>
<mask> // Command mkcert is a simple zero-config tool to make development certificates.
<mask> package main
</s> Fix and add missing license headers </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. </s> remove // Copyright 2018 The Go Authors. All rights reserved.
</s> add // Copyright 2018 The mkcert Authors. All rights reserved. | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/74ab68812eefef257330c0650859e618766d04c3 | main.go |
// Copyright 2018 The mkcert Authors. All rights reserved. | <mask> // Copyright 2018 The Go Authors. All rights reserved.
<mask> // Use of this source code is governed by a BSD-style
<mask> // license that can be found in the LICENSE file.
<mask>
<mask> package main
<mask>
</s> Fix and add missing license headers | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/74ab68812eefef257330c0650859e618766d04c3 | truststore_darwin.go |
// Copyright 2018 The mkcert Authors. All rights reserved. | <mask> // Copyright 2018 The Go Authors. All rights reserved.
<mask> // Use of this source code is governed by a BSD-style
<mask> // license that can be found in the LICENSE file.
<mask>
<mask> package main
<mask>
</s> Fix and add missing license headers | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/74ab68812eefef257330c0650859e618766d04c3 | truststore_java.go |
// Copyright 2018 The mkcert Authors. All rights reserved. | <mask> // Copyright 2018 The Go Authors. All rights reserved.
<mask> // Use of this source code is governed by a BSD-style
<mask> // license that can be found in the LICENSE file.
<mask>
<mask> package main
<mask>
</s> Fix and add missing license headers | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/74ab68812eefef257330c0650859e618766d04c3 | truststore_linux.go |
FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} | <mask> "howett.net/plist"
<mask> )
<mask>
<mask> var (
<mask> FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
<mask> CertutilInstallHelp = "brew install nss"
<mask> NSSBrowsers = "Firefox"
<mask> )
<mask>
<mask> // https://github.com/golang/go/issues/24652#issuecomment-399826583
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
</s> add FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" </s> remove profiles, _ := filepath.Glob(FirefoxProfile)
</s> add var profiles []string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_darwin.go |
FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" | <mask> "strings"
<mask> )
<mask>
<mask> var (
<mask> FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
<mask> NSSBrowsers = "Firefox and/or Chrome/Chromium"
<mask>
<mask> SystemTrustFilename string
<mask> SystemTrustCommand []string
<mask> CertutilInstallHelp string
<mask> )
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} </s> remove FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
</s> add FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} </s> remove profiles, _ := filepath.Glob(FirefoxProfile)
</s> add var profiles []string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_linux.go |
"/snap/firefox", | <mask> firefoxPaths = []string{
<mask> "/usr/bin/firefox",
<mask> "/usr/bin/firefox-nightly",
<mask> "/usr/bin/firefox-developer-edition",
<mask> "/Applications/Firefox.app",
<mask> "/Applications/FirefoxDeveloperEdition.app",
<mask> "/Applications/Firefox Developer Edition.app",
<mask> "/Applications/Firefox Nightly.app",
<mask> "C:\\Program Files\\Mozilla Firefox",
<mask> }
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} </s> remove FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
</s> add FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" </s> remove profiles, _ := filepath.Glob(FirefoxProfile)
</s> add var profiles []string | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_nss.go |
var profiles []string | <mask> return out, err
<mask> }
<mask>
<mask> func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
<mask> profiles, _ := filepath.Glob(FirefoxProfile)
<mask> profiles = append(profiles, nssDBs...)
<mask> for _, profile := range profiles {
<mask> if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
<mask> continue
<mask> }
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} </s> remove FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
</s> add FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_nss.go |
for _, ff := range FirefoxProfiles {
pp, _ := filepath.Glob(ff)
profiles = append(profiles, pp...)
} | <mask> var profiles []string
<mask> profiles = append(profiles, nssDBs...)
<mask> for _, profile := range profiles {
<mask> if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
<mask> continue
<mask> }
<mask> if pathExists(filepath.Join(profile, "cert9.db")) {
<mask> f("sql:" + profile)
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove profiles, _ := filepath.Glob(FirefoxProfile)
</s> add var profiles []string </s> remove FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
</s> add FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_nss.go |
FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"} | <mask> "unsafe"
<mask> )
<mask>
<mask> var (
<mask> FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
<mask> CertutilInstallHelp = "" // certutil unsupported on Windows
<mask> NSSBrowsers = "Firefox"
<mask> )
<mask>
<mask> var (
</s> Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327
Fixes #325 </s> remove FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"} </s> remove FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
</s> add FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium" </s> remove profiles, _ := filepath.Glob(FirefoxProfile)
</s> add var profiles []string | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/789f1b1c70a2d6420186f898ba7e8aae99afc81a | truststore_windows.go |
const shortUsage = `Usage of mkcert: | <mask>
<mask> "golang.org/x/net/idna"
<mask> )
<mask>
<mask> const usage = `Usage of mkcert:
<mask>
<mask> $ mkcert -install
<mask> Install the local CA in the system trust store.
<mask>
<mask> $ mkcert example.org
</s> Split off advanced options docs </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
$ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". | <mask>
<mask> $ mkcert example.com myapp.dev localhost 127.0.0.1 ::1
<mask> Generate "example.com+4.pem" and "example.com+4-key.pem".
<mask>
<mask> $ mkcert "*.example.com"
<mask> Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
<mask>
<mask> $ mkcert -pkcs12 example.com
<mask> Generate "example.com.p12" instead of a PEM file.
<mask>
<mask> $ mkcert -uninstall
<mask> Uninstall the local CA (but do not delete it).
<mask>
<mask> Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> Split off advanced options docs </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add </s> remove const usage = `Usage of mkcert:
</s> add const shortUsage = `Usage of mkcert: </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
`
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) | <mask>
<mask> $ mkcert -uninstall
<mask> Uninstall the local CA (but do not delete it).
<mask>
<mask> Use -cert-file, -key-file and -p12-file to customize the output paths.
<mask>
<mask> Change the CA certificate and key storage location by setting $CAROOT,
<mask> print it with "mkcert -CAROOT".
<mask> `
<mask>
</s> Split off advanced options docs </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". </s> remove const usage = `Usage of mkcert:
</s> add const shortUsage = `Usage of mkcert: </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
<mask> Uninstall the local CA (but do not delete it).
<mask>
<mask> Use -cert-file, -key-file and -p12-file to customize the output paths.
<mask>
<mask> Change the CA certificate and key storage location by setting $CAROOT,
<mask> print it with "mkcert -CAROOT".
<mask> `
<mask>
<mask> func main() {
<mask> log.SetFlags(0)
<mask> var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
</s> Split off advanced options docs </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". </s> remove const usage = `Usage of mkcert:
</s> add const shortUsage = `Usage of mkcert: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go | |
var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} | <mask> `
<mask>
<mask> func main() {
<mask> log.SetFlags(0)
<mask> var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
<mask> var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
<mask> var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
<mask> var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
<mask> var certFileFlag = flag.String("cert-file", "", "output certificate file path")
<mask> var keyFileFlag = flag.String("key-file", "", "output key file path")
<mask> var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
<mask> flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
<mask> flag.Parse()
<mask> if *carootFlag {
<mask> if *installFlag || *uninstallFlag {
<mask> log.Fatalln("ERROR: you can't set -[un]install and -CAROOT at the same time")
<mask> }
</s> Split off advanced options docs </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add </s> remove const usage = `Usage of mkcert:
</s> add const shortUsage = `Usage of mkcert: </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
if *helpFlag {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintf(flag.CommandLine.Output(), advancedUsage)
return
} | <mask> fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
<mask> }
<mask> flag.Parse()
<mask> if *carootFlag {
<mask> if *installFlag || *uninstallFlag {
<mask> log.Fatalln("ERROR: you can't set -[un]install and -CAROOT at the same time")
<mask> }
<mask> fmt.Println(getCAROOT())
</s> Split off advanced options docs </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} </s> remove log.Printf("\n%s", usage)
</s> add flag.Usage() </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
flag.Usage() | <mask> }
<mask> }
<mask>
<mask> if len(args) == 0 {
<mask> log.Printf("\n%s", usage)
<mask> return
<mask> }
<mask>
<mask> hostnameRegexp := regexp.MustCompile(`(?i)^(\*\.)?[0-9a-z_-]([0-9a-z._-]*[0-9a-z_-])?$`)
<mask> for i, name := range args {
</s> Split off advanced options docs </s> remove var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
var certFileFlag = flag.String("cert-file", "", "output certificate file path")
var keyFileFlag = flag.String("key-file", "", "output key file path")
var p12FileFlag = flag.String("p12-file", "", "output PKCS#12 file path")
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
</s> add var (
installFlag = flag.Bool("install", false, "")
uninstallFlag = flag.Bool("uninstall", false, "")
pkcs12Flag = flag.Bool("pkcs12", false, "")
helpFlag = flag.Bool("help", false, "")
carootFlag = flag.Bool("CAROOT", false, "")
certFileFlag = flag.String("cert-file", "", "")
keyFileFlag = flag.String("key-file", "", "")
p12FileFlag = flag.String("p12-file", "", "")
)
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} </s> remove Use -cert-file, -key-file and -p12-file to customize the output paths.
</s> add `
const advancedUsage = `Advanced options:
-cert-file FILE, -key-file FILE, -p12-file FILE
Customize the output paths.
-pkcs12
Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
containing certificate and key for legacy applications.
-CAROOT
Print the CA certificate and key storage location.
$CAROOT (environment variable)
Set the CA certificate and key storage location. (This allows
maintaining multiple local CAs in parallel.) </s> remove Change the CA certificate and key storage location by setting $CAROOT,
print it with "mkcert -CAROOT".
</s> add </s> remove $ mkcert "*.example.com"
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
$ mkcert -pkcs12 example.com
Generate "example.com.p12" instead of a PEM file.
</s> add $ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem". | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/821679b01f4870b672dfd03c4983b4e534ced34b | main.go |
<mask> language: go
<mask> sudo: false
<mask> go: stable
<mask> install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
<mask>
<mask> script:
<mask> - go vet
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
</s> add </s> remove - go vet
- staticcheck ./...
</s> add - go run analysis.go ./... | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | .travis.yml | |
<mask> language: go
<mask> sudo: false
<mask> go: stable
<mask> install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
<mask>
<mask> script:
<mask> - go vet
<mask> - staticcheck ./...
<mask> - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64"
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove - go vet
- staticcheck ./...
</s> add - go run analysis.go ./... </s> remove sudo: false
</s> add | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | .travis.yml | |
- go run analysis.go ./... | <mask> go: stable
<mask> install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
<mask>
<mask> script:
<mask> - go vet
<mask> - staticcheck ./...
<mask> - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64"
<mask> - CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "mkcert-$(git describe --tags)-linux-arm"
<mask> - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-darwin-amd64"
<mask> - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-windows-amd64.exe"
<mask>
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
</s> add </s> remove sudo: false
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | .travis.yml |
go 1.13
| <mask> module github.com/FiloSottile/mkcert
<mask>
<mask> require (
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859
<mask> golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
<mask> honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc
<mask> howett.net/plist v0.0.0-20181124034731-591f970eefbb
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.mod |
golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc | <mask> module github.com/FiloSottile/mkcert
<mask>
<mask> require (
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
<mask> golang.org/x/text v0.3.0 // indirect
<mask> howett.net/plist v0.0.0-20181124034731-591f970eefbb
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237
<mask> )
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | [
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.mod |
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
<mask> github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
<mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
<mask> github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
<mask> github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
<mask> golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.sum |
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | <mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
<mask> github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
<mask> golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.sum |
golang.org/x/tools v0.0.0-20191022074931-774d2ec196ee/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11 h1:Yq9t9jnGoR+dBuitxdo9l6Q7xh/zOyNnYUtDKaQ3x0E=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | <mask> golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
<mask> gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.sum |
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | <mask> golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
<mask> honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc h1:G3KJU7T3tdNpGfKsED8OHHsQozNxEW0rDS785ks+feY=
<mask> honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc/go.mod h1:bskWClgaWw7pMntzj97vj6x8S0hIhRBiTMJkNmGWTLE=
<mask> howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.sum |
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc h1:G3KJU7T3tdNpGfKsED8OHHsQozNxEW0rDS785ks+feY=
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc/go.mod h1:bskWClgaWw7pMntzj97vj6x8S0hIhRBiTMJkNmGWTLE= | <mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
<mask> gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
<mask> howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=
<mask> howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237 h1:iAEkCBPbRaflBgZ7o9gjVUuWuvWeV4sytFWg9o+Pj2k=
<mask> software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237/go.mod h1:/xvNRWUqm0+/ZMiF4EX00vrSCMsE4/NHb+Pt3freEeQ=
</s> analysis.go: use x/tools/go/analysis/multichecker to run analysis tools
This pattern has a number of advantages: it tracks the versions of the
tools in go.mod, it doesn't require installing anything in CI, it runs
all analysis passes at once, and it lets us add custom ones easily. </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b
golang.org/x/text v0.3.0 // indirect
</s> add golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11
honnef.co/go/tools v0.0.0-20191107024926-a9480a3ec3bc </s> remove golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b h1:oXs/nlnyk1ue6g+mFGEHIuIaQIT28IgumdSIRMq2aJY=
golang.org/x/net v0.0.0-20180627171509-e514e69ffb8b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
</s> add github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/82ea753aa2a8050fc7799c18afc81300d8547d1c | go.sum |
nssDBs = []string{
filepath.Join(os.Getenv("HOME"), ".pki/nssdb"),
filepath.Join(os.Getenv("HOME"), "snap/chromium/current/.pki/nssdb"), // Snapcraft
"/etc/pki/nssdb", // CentOS 7
}
firefoxPaths = []string{
"/usr/bin/firefox", "/Applications/Firefox.app", | <mask> var (
<mask> hasNSS bool
<mask> hasCertutil bool
<mask> certutilPath string
<mask> nssDB = filepath.Join(os.Getenv("HOME"), ".pki/nssdb")
<mask> )
<mask>
<mask> func init() {
<mask> for _, path := range []string{
<mask> "/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
<mask> "/Applications/Firefox Developer Edition.app",
<mask> "/Applications/Firefox Nightly.app",
<mask> "C:\\Program Files\\Mozilla Firefox",
<mask> } {
<mask> hasNSS = hasNSS || pathExists(path)
</s> truststore_nss: support multiple NSS databases
This adds support for Snap's Chromium, and and CentOS 7.
Fixes #116
Fixes #120
Closes #121 </s> remove } {
hasNSS = hasNSS || pathExists(path)
</s> add }
)
func init() {
allPaths := append(append([]string{}, nssDBs...), firefoxPaths...)
for _, path := range allPaths {
if pathExists(path) {
hasNSS = true
break
} </s> remove if pathExists(nssDB) {
profiles = append(profiles, nssDB)
}
if len(profiles) == 0 {
return
}
</s> add profiles = append(profiles, nssDBs...) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/8d9e4345207013c55a8719995ec4ad4e9be466f2 | truststore_nss.go |
}
)
func init() {
allPaths := append(append([]string{}, nssDBs...), firefoxPaths...)
for _, path := range allPaths {
if pathExists(path) {
hasNSS = true
break
} | <mask> "/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
<mask> "/Applications/Firefox Developer Edition.app",
<mask> "/Applications/Firefox Nightly.app",
<mask> "C:\\Program Files\\Mozilla Firefox",
<mask> } {
<mask> hasNSS = hasNSS || pathExists(path)
<mask> }
<mask>
<mask> switch runtime.GOOS {
<mask> case "darwin":
<mask> if hasCertutil = binaryExists("certutil"); hasCertutil {
</s> truststore_nss: support multiple NSS databases
This adds support for Snap's Chromium, and and CentOS 7.
Fixes #116
Fixes #120
Closes #121 </s> remove nssDB = filepath.Join(os.Getenv("HOME"), ".pki/nssdb")
)
func init() {
for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
</s> add nssDBs = []string{
filepath.Join(os.Getenv("HOME"), ".pki/nssdb"),
filepath.Join(os.Getenv("HOME"), "snap/chromium/current/.pki/nssdb"), // Snapcraft
"/etc/pki/nssdb", // CentOS 7
}
firefoxPaths = []string{
"/usr/bin/firefox", "/Applications/Firefox.app", </s> remove if pathExists(nssDB) {
profiles = append(profiles, nssDB)
}
if len(profiles) == 0 {
return
}
</s> add profiles = append(profiles, nssDBs...) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/8d9e4345207013c55a8719995ec4ad4e9be466f2 | truststore_nss.go |
profiles = append(profiles, nssDBs...) | <mask> }
<mask>
<mask> func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
<mask> profiles, _ := filepath.Glob(FirefoxProfile)
<mask> if pathExists(nssDB) {
<mask> profiles = append(profiles, nssDB)
<mask> }
<mask> if len(profiles) == 0 {
<mask> return
<mask> }
<mask> for _, profile := range profiles {
<mask> if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
<mask> continue
<mask> }
<mask> if pathExists(filepath.Join(profile, "cert9.db")) {
</s> truststore_nss: support multiple NSS databases
This adds support for Snap's Chromium, and and CentOS 7.
Fixes #116
Fixes #120
Closes #121 </s> remove } {
hasNSS = hasNSS || pathExists(path)
</s> add }
)
func init() {
allPaths := append(append([]string{}, nssDBs...), firefoxPaths...)
for _, path := range allPaths {
if pathExists(path) {
hasNSS = true
break
} </s> remove nssDB = filepath.Join(os.Getenv("HOME"), ".pki/nssdb")
)
func init() {
for _, path := range []string{
"/usr/bin/firefox", nssDB, "/Applications/Firefox.app",
</s> add nssDBs = []string{
filepath.Join(os.Getenv("HOME"), ".pki/nssdb"),
filepath.Join(os.Getenv("HOME"), "snap/chromium/current/.pki/nssdb"), // Snapcraft
"/etc/pki/nssdb", // CentOS 7
}
firefoxPaths = []string{
"/usr/bin/firefox", "/Applications/Firefox.app", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/8d9e4345207013c55a8719995ec4ad4e9be466f2 | truststore_nss.go |
<mask> priv, err := m.generateKey(false)
<mask> fatalIfErr(err, "failed to generate certificate key")
<mask> pub := priv.(crypto.Signer).Public()
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: serialNumber,
<mask> Subject: pkix.Name{
<mask> Organization: []string{"mkcert development certificate"},
<mask> OrganizationalUnit: []string{userAndHostname},
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | cert.go | |
SerialNumber: randomSerialNumber(), | <mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: serialNumber,
<mask> Subject: pkix.Name{
<mask> Organization: []string{"mkcert development certificate"},
<mask> OrganizationalUnit: []string{userAndHostname},
<mask> },
<mask>
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | cert.go |
fatalIfErr(err, "failed to save certificate") | <mask> fatalIfErr(err, "failed to save certificate key")
<mask>
<mask> err = ioutil.WriteFile(certFile, pem.EncodeToMemory(
<mask> &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
<mask> fatalIfErr(err, "failed to save certificate key")
<mask> } else {
<mask> domainCert, _ := x509.ParseCertificate(cert)
<mask> pfxData, err := pkcs12.Encode(rand.Reader, priv, domainCert, []*x509.Certificate{m.caCert}, "changeit")
<mask> fatalIfErr(err, "failed to generate PKCS#12")
<mask> err = ioutil.WriteFile(p12File, pfxData, 0644)
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | cert.go |
<mask> priv, err := m.generateKey(true)
<mask> fatalIfErr(err, "failed to generate the CA key")
<mask> pub := priv.(crypto.Signer).Public()
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
<mask>
<mask> spkiASN1, err := x509.MarshalPKIXPublicKey(pub)
<mask> fatalIfErr(err, "failed to encode public key")
<mask>
<mask> var spki struct {
<mask> Algorithm pkix.AlgorithmIdentifier
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | cert.go | |
SerialNumber: randomSerialNumber(), | <mask>
<mask> skid := sha1.Sum(spki.SubjectPublicKey.Bytes)
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: serialNumber,
<mask> Subject: pkix.Name{
<mask> Organization: []string{"mkcert development CA"},
<mask> OrganizationalUnit: []string{userAndHostname},
<mask>
<mask> // The CommonName is required by iOS to show the certificate in the
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | cert.go |
-csr CSR
Generate a certificate based on the supplied CSR. Conflicts with
all other flags and arguments except -install and -cert-file.
| <mask> -pkcs12
<mask> Generate a ".p12" PKCS #12 file, also know as a ".pfx" file,
<mask> containing certificate and key for legacy applications.
<mask>
<mask> -CAROOT
<mask> Print the CA certificate and key storage location.
<mask>
<mask> $CAROOT (environment variable)
<mask> Set the CA certificate and key storage location. (This allows
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
csrFlag = flag.String("csr", "", "") | <mask> clientFlag = flag.Bool("client", false, "")
<mask> helpFlag = flag.Bool("help", false, "")
<mask> carootFlag = flag.Bool("CAROOT", false, "")
<mask> certFileFlag = flag.String("cert-file", "", "")
<mask> keyFileFlag = flag.String("key-file", "", "")
<mask> p12FileFlag = flag.String("p12-file", "", "")
<mask> )
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
if *csrFlag != "" && (*pkcs12Flag || *ecdsaFlag || *clientFlag) {
log.Fatalln("ERROR: can only combine -csr with -install and -cert-file")
}
if *csrFlag != "" && flag.NArg() != 0 {
log.Fatalln("ERROR: can't specify extra arguments when using -csr")
} | <mask> log.Fatalln("ERROR: you can't set -install and -uninstall at the same time")
<mask> }
<mask> (&mkcert{
<mask> installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag,
<mask> pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, client: *clientFlag,
<mask> certFile: *certFileFlag, keyFile: *keyFileFlag, p12File: *p12FileFlag,
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, | <mask> if *installFlag && *uninstallFlag {
<mask> log.Fatalln("ERROR: you can't set -install and -uninstall at the same time")
<mask> }
<mask> (&mkcert{
<mask> installMode: *installFlag, uninstallMode: *uninstallFlag,
<mask> pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, client: *clientFlag,
<mask> certFile: *certFileFlag, keyFile: *keyFileFlag, p12File: *p12FileFlag,
<mask> }).Run(flag.Args())
<mask> }
<mask>
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
csrPath string | <mask> type mkcert struct {
<mask> installMode, uninstallMode bool
<mask> pkcs12, ecdsa, client bool
<mask> keyFile, certFile, p12File string
<mask>
<mask> CAROOT string
<mask> caCert *x509.Certificate
<mask> caKey crypto.PrivateKey
<mask>
<mask> // The system cert pool is only loaded once. After installing the root, checks
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove SerialNumber: serialNumber,
</s> add SerialNumber: randomSerialNumber(), </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
if m.csrPath != "" {
m.makeCertFromCSR()
return
}
| <mask> }
<mask>
<mask> if len(args) == 0 {
<mask> flag.Usage()
<mask> return
<mask> }
<mask>
</s> Add support for certificate signing requests with -csr
Closes #55 </s> remove installMode: *installFlag, uninstallMode: *uninstallFlag,
</s> add installMode: *installFlag, uninstallMode: *uninstallFlag, csrPath: *csrFlag, </s> remove fatalIfErr(err, "failed to save certificate key")
</s> add fatalIfErr(err, "failed to save certificate") </s> remove serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
fatalIfErr(err, "failed to generate serial number")
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/99e15e29f975e5fa7c897e04015aeba30b692749 | main.go |
expiration := time.Now().AddDate(2, 3, 0) | <mask> fatalIfErr(err, "failed to parse the CSR")
<mask> fatalIfErr(csr.CheckSignature(), "invalid CSR signature")
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: randomSerialNumber(),
<mask> Subject: csr.Subject,
<mask> ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs
<mask>
<mask> NotBefore: time.Now(), NotAfter: expiration,
</s> Make CSR code match standard certificate generation </s> remove ExtraExtensions: csr.Extensions, // includes requested SANs
NotAfter: time.Now().AddDate(10, 0, 0),
NotBefore: time.Now(),
</s> add ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs </s> remove KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
</s> add NotBefore: time.Now(), NotAfter: expiration, </s> remove if len(hosts) == 0 {
hosts = []string{csr.Subject.CommonName}
</s> add for _, uri := range csr.URIs {
hosts = append(hosts, uri.String()) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9c196b6cdb3bfaa43504a52bf52ae41644f0094f | cert.go |
ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs | <mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: randomSerialNumber(),
<mask> Subject: csr.Subject,
<mask> ExtraExtensions: csr.Extensions, // includes requested SANs
<mask>
<mask> NotAfter: time.Now().AddDate(10, 0, 0),
<mask> NotBefore: time.Now(),
<mask>
<mask> KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
<mask> ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
<mask> BasicConstraintsValid: true,
<mask>
</s> Make CSR code match standard certificate generation </s> remove KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
</s> add NotBefore: time.Now(), NotAfter: expiration, </s> remove if len(hosts) == 0 {
hosts = []string{csr.Subject.CommonName}
</s> add for _, uri := range csr.URIs {
hosts = append(hosts, uri.String()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9c196b6cdb3bfaa43504a52bf52ae41644f0094f | cert.go |
NotBefore: time.Now(), NotAfter: expiration, | <mask>
<mask> NotAfter: time.Now().AddDate(10, 0, 0),
<mask> NotBefore: time.Now(),
<mask>
<mask> KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
<mask> ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
<mask> BasicConstraintsValid: true,
<mask>
<mask> // If the CSR does not request a SAN extension, fix it up for them as
<mask> // the Common Name field does not work in modern browsers. Otherwise,
<mask> // this will get overridden.
<mask> DNSNames: []string{csr.Subject.CommonName},
</s> Make CSR code match standard certificate generation </s> remove ExtraExtensions: csr.Extensions, // includes requested SANs
NotAfter: time.Now().AddDate(10, 0, 0),
NotBefore: time.Now(),
</s> add ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs </s> remove if len(hosts) == 0 {
hosts = []string{csr.Subject.CommonName}
</s> add for _, uri := range csr.URIs {
hosts = append(hosts, uri.String()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9c196b6cdb3bfaa43504a52bf52ae41644f0094f | cert.go |
// Likewise, if the CSR does not set KUs and EKUs, fix it up as Apple
// platforms require serverAuth for TLS.
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
}
if m.client {
tpl.ExtKeyUsage = append(tpl.ExtKeyUsage, x509.ExtKeyUsageClientAuth)
}
if len(csr.EmailAddresses) > 0 {
tpl.ExtKeyUsage = append(tpl.ExtKeyUsage, x509.ExtKeyUsageEmailProtection) | <mask> // this will get overridden.
<mask> DNSNames: []string{csr.Subject.CommonName},
<mask> }
<mask>
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, csr.PublicKey, m.caKey)
<mask> fatalIfErr(err, "failed to generate certificate")
<mask>
<mask> var hosts []string
</s> Make CSR code match standard certificate generation </s> remove KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
</s> add NotBefore: time.Now(), NotAfter: expiration, </s> remove if len(hosts) == 0 {
hosts = []string{csr.Subject.CommonName}
</s> add for _, uri := range csr.URIs {
hosts = append(hosts, uri.String()) </s> remove ExtraExtensions: csr.Extensions, // includes requested SANs
NotAfter: time.Now().AddDate(10, 0, 0),
NotBefore: time.Now(),
</s> add ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9c196b6cdb3bfaa43504a52bf52ae41644f0094f | cert.go |
for _, uri := range csr.URIs {
hosts = append(hosts, uri.String()) | <mask> hosts = append(hosts, csr.EmailAddresses...)
<mask> for _, ip := range csr.IPAddresses {
<mask> hosts = append(hosts, ip.String())
<mask> }
<mask> if len(hosts) == 0 {
<mask> hosts = []string{csr.Subject.CommonName}
<mask> }
<mask> certFile, _, _ := m.fileNames(hosts)
<mask>
<mask> err = ioutil.WriteFile(certFile, pem.EncodeToMemory(
<mask> &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
</s> Make CSR code match standard certificate generation </s> remove ExtraExtensions: csr.Extensions, // includes requested SANs
NotAfter: time.Now().AddDate(10, 0, 0),
NotBefore: time.Now(),
</s> add ExtraExtensions: csr.Extensions, // includes requested SANs, KUs and EKUs </s> remove KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
</s> add NotBefore: time.Now(), NotAfter: expiration, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9c196b6cdb3bfaa43504a52bf52ae41644f0094f | cert.go |
"crypto/sha1" | <mask> import (
<mask> "crypto/rand"
<mask> "crypto/rsa"
<mask> "crypto/x509"
<mask> "crypto/x509/pkix"
<mask> "encoding/asn1"
<mask> "encoding/pem"
<mask> "io/ioutil"
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 </s> remove pub := priv.PublicKey
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go |
"encoding/asn1" | <mask> "crypto/x509"
<mask> "crypto/x509/pkix"
<mask> "encoding/pem"
<mask> "io/ioutil"
<mask> "log"
<mask> "math/big"
<mask> "net"
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 </s> remove pub := priv.PublicKey
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go |
pub := priv.PublicKey | <mask> priv, err := rsa.GenerateKey(rand.Reader, 3072)
<mask> fatalIfErr(err, "failed to generate the CA key")
<mask>
<mask> serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
<mask> fatalIfErr(err, "failed to generate serial number")
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 </s> remove pub := priv.PublicKey
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go |
spkiASN1, err := x509.MarshalPKIXPublicKey(&pub)
fatalIfErr(err, "failed to encode public key")
var spki struct {
Algorithm pkix.AlgorithmIdentifier
SubjectPublicKey asn1.BitString
}
_, err = asn1.Unmarshal(spkiASN1, &spki)
fatalIfErr(err, "failed to decode public key")
skid := sha1.Sum(spki.SubjectPublicKey.Bytes)
| <mask> fatalIfErr(err, "failed to generate serial number")
<mask>
<mask> tpl := &x509.Certificate{
<mask> SerialNumber: serialNumber,
<mask> Subject: pkix.Name{
<mask> Organization: []string{"mkcert development CA"},
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 </s> remove pub := priv.PublicKey
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go |
SubjectKeyId: skid[:], | <mask> Subject: pkix.Name{
<mask> Organization: []string{"mkcert development CA"},
<mask> OrganizationalUnit: []string{userAndHostname},
<mask> },
<mask>
<mask> NotAfter: time.Now().AddDate(10, 0, 0),
<mask> NotBefore: time.Now(),
<mask>
<mask> KeyUsage: x509.KeyUsageCertSign,
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 </s> remove pub := priv.PublicKey
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go |
<mask> IsCA: true,
<mask> MaxPathLenZero: true,
<mask> }
<mask>
<mask> pub := priv.PublicKey
<mask> cert, err := x509.CreateCertificate(rand.Reader, tpl, tpl, &pub, priv)
<mask> fatalIfErr(err, "failed to generate CA certificate")
<mask>
<mask> privDER, err := x509.MarshalPKCS8PrivateKey(priv)
<mask> fatalIfErr(err, "failed to encode CA key")
</s> Add a SubjectKeyId to the root CA
Not really useful for #47, but good to have and a RFC 5280 MUST.
See https://twitter.com/FiloSottile/status/1023564776834826240 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/9e258bad935b5bc36cf9f2ba720b3cd21f25a227 | cert.go | |
"os/user" | <mask> "net/mail"
<mask> "net/url"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask> "regexp"
<mask> "runtime"
<mask> "strings"
<mask> "sync"
</s> Specify a "Sudo password:" prompt for sudo
Fixes #178
Closes #185 </s> remove "os/exec"
</s> add </s> remove "os/exec"
</s> add </s> remove
func CommandWithSudo(cmd ...string) *exec.Cmd {
if !binaryExists("sudo") {
return exec.Command(cmd[0], cmd[1:]...)
}
return exec.Command("sudo", append([]string{"--"}, cmd...)...)
}
</s> add </s> remove cmd = CommandWithSudo(SystemTrustCommand...)
</s> add cmd = commandWithSudo(SystemTrustCommand...) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/aa4dd610664a3b092f35cb7c996d94e3c3da6159 | main.go |
"sync" | <mask> "path/filepath"
<mask> "regexp"
<mask> "runtime"
<mask> "strings"
<mask>
<mask> "golang.org/x/net/idna"
<mask> )
<mask>
<mask> const shortUsage = `Usage of mkcert:
</s> Specify a "Sudo password:" prompt for sudo
Fixes #178
Closes #185 </s> remove "os/exec"
</s> add </s> remove "os/exec"
</s> add </s> remove cmd = CommandWithSudo(SystemTrustCommand...)
</s> add cmd = commandWithSudo(SystemTrustCommand...) </s> remove cmd = exec.Command("sudo", keytoolPath)
</s> add cmd = commandWithSudo(keytoolPath) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/aa4dd610664a3b092f35cb7c996d94e3c3da6159 | main.go |
<mask> "encoding/asn1"
<mask> "io/ioutil"
<mask> "log"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
<mask>
<mask> "howett.net/plist"
<mask> )
<mask>
</s> Specify a "Sudo password:" prompt for sudo
Fixes #178
Closes #185 </s> remove "os/exec"
</s> add </s> remove
func CommandWithSudo(cmd ...string) *exec.Cmd {
if !binaryExists("sudo") {
return exec.Command(cmd[0], cmd[1:]...)
}
return exec.Command("sudo", append([]string{"--"}, cmd...)...)
}
</s> add </s> remove cmd = CommandWithSudo(SystemTrustCommand...)
</s> add cmd = commandWithSudo(SystemTrustCommand...) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/aa4dd610664a3b092f35cb7c996d94e3c3da6159 | truststore_darwin.go | |
cmd := commandWithSudo("security", "add-trusted-cert", "-d", "-k", "/Library/Keychains/System.keychain", filepath.Join(m.CAROOT, rootName)) | <mask> </array>
<mask> `)
<mask>
<mask> func (m *mkcert) installPlatform() bool {
<mask> cmd := exec.Command("sudo", "security", "add-trusted-cert", "-d", "-k", "/Library/Keychains/System.keychain", filepath.Join(m.CAROOT, rootName))
<mask> out, err := cmd.CombinedOutput()
<mask> fatalIfCmdErr(err, "security add-trusted-cert", out)
<mask>
<mask> // Make trustSettings explicit, as older Go does not know the defaults.
<mask> // https://github.com/golang/go/issues/24652
</s> Specify a "Sudo password:" prompt for sudo
Fixes #178
Closes #185 </s> remove cmd := exec.Command("sudo", "security", "remove-trusted-cert", "-d", filepath.Join(m.CAROOT, rootName))
</s> add cmd := commandWithSudo("security", "remove-trusted-cert", "-d", filepath.Join(m.CAROOT, rootName)) </s> remove // the command wrapped in 'sudo' to work around file permissions.
</s> add // the command with commandWithSudo to work around file permissions. </s> remove cmd = exec.Command("sudo", "security", "trust-settings-export", "-d", plistFile.Name())
</s> add cmd = commandWithSudo("security", "trust-settings-export", "-d", plistFile.Name()) </s> remove cmd := CommandWithSudo("rm", "-f", legacyFilename)
</s> add cmd := commandWithSudo("rm", "-f", legacyFilename) </s> remove cmd := CommandWithSudo("rm", "-f", m.systemTrustFilename())
</s> add cmd := commandWithSudo("rm", "-f", m.systemTrustFilename()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/aa4dd610664a3b092f35cb7c996d94e3c3da6159 | truststore_darwin.go |
cmd = commandWithSudo("security", "trust-settings-export", "-d", plistFile.Name()) | <mask> plistFile, err := ioutil.TempFile("", "trust-settings")
<mask> fatalIfErr(err, "failed to create temp file")
<mask> defer os.Remove(plistFile.Name())
<mask>
<mask> cmd = exec.Command("sudo", "security", "trust-settings-export", "-d", plistFile.Name())
<mask> out, err = cmd.CombinedOutput()
<mask> fatalIfCmdErr(err, "security trust-settings-export", out)
<mask>
<mask> plistData, err := ioutil.ReadFile(plistFile.Name())
<mask> fatalIfErr(err, "failed to read trust settings")
</s> Specify a "Sudo password:" prompt for sudo
Fixes #178
Closes #185 </s> remove cmd = exec.Command("sudo", "security", "trust-settings-import", "-d", plistFile.Name())
</s> add cmd = commandWithSudo("security", "trust-settings-import", "-d", plistFile.Name()) </s> remove cmd := CommandWithSudo("tee", m.systemTrustFilename())
</s> add cmd := commandWithSudo("tee", m.systemTrustFilename()) </s> remove cmd := exec.Command("sudo", "security", "remove-trusted-cert", "-d", filepath.Join(m.CAROOT, rootName))
</s> add cmd := commandWithSudo("security", "remove-trusted-cert", "-d", filepath.Join(m.CAROOT, rootName)) </s> remove cmd = CommandWithSudo(SystemTrustCommand...)
</s> add cmd = commandWithSudo(SystemTrustCommand...) </s> remove cmd = CommandWithSudo(SystemTrustCommand...)
</s> add cmd = commandWithSudo(SystemTrustCommand...) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/FiloSottile/mkcert/commit/aa4dd610664a3b092f35cb7c996d94e3c3da6159 | truststore_darwin.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.