mirror of
https://wiilab.wiimart.org/wiimart/WiiMart-Patcher
synced 2025-09-04 04:21:19 +02:00
parent
79a712e3ad
commit
4a232c552b
@ -50,23 +50,24 @@ func createCertificates() []byte {
|
|||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
// Issue server TLS certificate //
|
// Issue server TLS certificate //
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
// We'll issue a wildcard for our CN and SANs.
|
||||||
|
// Is this recommended? Absolutely not, but who's to stop us?
|
||||||
|
issueName := "*." + baseDomain
|
||||||
serverCert := x509.Certificate{
|
serverCert := x509.Certificate{
|
||||||
SignatureAlgorithm: x509.SHA1WithRSA,
|
SignatureAlgorithm: x509.SHA1WithRSA,
|
||||||
SerialNumber: generateSerial(),
|
SerialNumber: generateSerial(),
|
||||||
// We'll issue with a primary common name for our base domain.
|
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
CommonName: baseDomain,
|
CommonName: issueName,
|
||||||
},
|
},
|
||||||
// The SAN will be a wildcard for our base domain, as it cannot be the CN.
|
|
||||||
DNSNames: []string{
|
DNSNames: []string{
|
||||||
"*." + baseDomain,
|
issueName,
|
||||||
},
|
},
|
||||||
NotBefore: YearIssueTime,
|
NotBefore: YearIssueTime,
|
||||||
NotAfter: YearIssueTime.AddDate(10, 0, 0),
|
NotAfter: YearIssueTime.AddDate(10, 0, 0),
|
||||||
KeyUsage: x509.KeyUsageKeyAgreement | x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
KeyUsage: x509.KeyUsageKeyAgreement | x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
||||||
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
|
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
|
||||||
IsCA: false,
|
BasicConstraintsValid: true,
|
||||||
MaxPathLenZero: true,
|
IsCA: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
serverPriv, err := rsa.GenerateKey(rand.Reader, 2048)
|
serverPriv, err := rsa.GenerateKey(rand.Reader, 2048)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user