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