Correctly part pem encoded blocks
This commit is contained in:
parent
80469dfbd1
commit
94e345d356
6
cert.go
6
cert.go
@ -59,12 +59,14 @@ func LoadCertGen(certBytes, keyBytes []byte) (*CertGen, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
leaf := TlsLeaf(&pair)
|
leaf := TlsLeaf(&pair)
|
||||||
|
certBlock, _ := pem.Decode(certBytes)
|
||||||
|
keyBlock, _ := pem.Decode(keyBytes)
|
||||||
gen := &CertGen{
|
gen := &CertGen{
|
||||||
tlsCert: pair,
|
tlsCert: pair,
|
||||||
cert: leaf,
|
cert: leaf,
|
||||||
key: pair.PrivateKey,
|
key: pair.PrivateKey,
|
||||||
certBytes: certBytes,
|
certBytes: certBlock.Bytes,
|
||||||
keyBytes: keyBytes,
|
keyBytes: keyBlock.Bytes,
|
||||||
}
|
}
|
||||||
err = gen.generatePem()
|
err = gen.generatePem()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user