mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
kubeadm: use client-go's MakeCSRFromTemplate() in 'renew'
Create CSR using the mentioned function which also encodes the type CertificateRequestBlockType. Without that 'certs renew' is failing with: 'PEM block type must be CERTIFICATE REQUEST'
This commit is contained in:
parent
224448b858
commit
8bc0447d8c
@ -17,7 +17,6 @@ limitations under the License.
|
||||
package renewal
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
@ -70,7 +69,7 @@ func (r *CertsAPIRenewal) Renew(cfg *certutil.Config) (*x509.Certificate, *rsa.P
|
||||
return nil, nil, errors.Wrap(err, "couldn't create new private key")
|
||||
}
|
||||
|
||||
csr, err := x509.CreateCertificateRequest(rand.Reader, reqTmp, key)
|
||||
csr, err := certutil.MakeCSRFromTemplate(key, reqTmp)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "couldn't create certificate signing request")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user