Remove ski creds specific code
This commit is contained in:
parent
c86bc8d7e1
commit
ea5b79d8d8
12
ca.go
12
ca.go
@ -11,16 +11,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func MakeCaTls() (*CertGen, error) {
|
||||
func MakeCaTls(name pkix.Name, serialNumber *big.Int) (*CertGen, error) {
|
||||
ca := &x509.Certificate{
|
||||
SerialNumber: big.NewInt(29052019),
|
||||
Subject: pkix.Name{
|
||||
Organization: []string{"Ski Creds CA"},
|
||||
Country: []string{"GB"},
|
||||
Province: []string{""},
|
||||
Locality: []string{"London"},
|
||||
CommonName: "ski-creds-ca",
|
||||
},
|
||||
SerialNumber: serialNumber,
|
||||
Subject: name,
|
||||
NotBefore: time.Now(),
|
||||
NotAfter: time.Now().AddDate(10, 0, 0),
|
||||
IsCA: true,
|
||||
|
12
client.go
12
client.go
@ -11,16 +11,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func MakeClientTls() (*CertGen, error) {
|
||||
func MakeClientTls(name pkix.Name, serialNumber *big.Int) (*CertGen, error) {
|
||||
cert := &x509.Certificate{
|
||||
SerialNumber: big.NewInt(29052019),
|
||||
Subject: pkix.Name{
|
||||
Organization: []string{"Ski Creds Client"},
|
||||
Country: []string{"GB"},
|
||||
Province: []string{""},
|
||||
Locality: []string{"London"},
|
||||
CommonName: "ski-creds-client",
|
||||
},
|
||||
SerialNumber: serialNumber,
|
||||
Subject: name,
|
||||
NotBefore: time.Now(),
|
||||
NotAfter: time.Now().AddDate(10, 0, 0),
|
||||
SubjectKeyId: []byte{1, 2, 3, 4, 6},
|
||||
|
16
server.go
16
server.go
@ -8,20 +8,16 @@ import (
|
||||
"crypto/x509/pkix"
|
||||
"log"
|
||||
"math/big"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func MakeServerTls(ca *CertGen) (*CertGen, error) {
|
||||
func MakeServerTls(ca *CertGen, name pkix.Name, serialNumber *big.Int, dnsNames []string, ipAddresses []net.IP) (*CertGen, error) {
|
||||
cert := &x509.Certificate{
|
||||
SerialNumber: big.NewInt(29052019),
|
||||
Subject: pkix.Name{
|
||||
Organization: []string{"Ski Creds Server"},
|
||||
Country: []string{"GB"},
|
||||
Province: []string{""},
|
||||
Locality: []string{"London"},
|
||||
CommonName: "ski-creds-server",
|
||||
},
|
||||
DNSNames: []string{"panda.local"},
|
||||
SerialNumber: serialNumber,
|
||||
Subject: name,
|
||||
DNSNames: dnsNames,
|
||||
IPAddresses: ipAddresses,
|
||||
NotBefore: time.Now(),
|
||||
NotAfter: time.Now().AddDate(10, 0, 0),
|
||||
SubjectKeyId: []byte{1, 2, 3, 4, 6},
|
||||
|
Loading…
Reference in New Issue
Block a user