Error while creating CertificateSigningRequest

Hi,

In “Security” Lecture , “Certificates API” topic, “practice test certificate API”

  • there is a task to create a CertificateSigningRequest object from a akshay.csr file

  • I dervied the base 64 of the akshay.csr file by “cat akshay.csr | base64” and pasted in the yaml file( attached screen shot below)

  • When i try to execute “kubectl create -f akshay.yml”, i am getting the below error, how you guys overcame it

    master $ kubectl create -f akshay.yml
    Error from server (BadRequest): error when creating “akshay.yml”: CertificateSigningRequest in version “v1beta1” cannot be handled as a CertificateSigningRequest: v1beta1.CertificateSigningRequest.Spec: v1beta1.CertificateSigningRequestSpec.Usages: []v1beta1.KeyUsage: Request: decode base64: illegal base64 data at input byte 76, error found in #10 byte of …|tLS0tLQo=“,“usages”:|…, bigger context …|Ci0t LS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQo=”,“usages”:[“digital signature”,“key encipherment”,|…

Hi siva,
Because run this command before you create CertificateSigningReques.

cat akshay.csr | base64 | tr -d '\n'

and try again.

1 Like