gcloud – Google Cloud Shell Terminal: Unable to read file [Errno 36] File name too long for PEM formatted (self managed) certificate


I have set up a load balancer in google cloud via the GUI, now I want to set it up via gcloud shell.
During the step to set up a (self managed) certificate, I get a message from the gcloud shell:

ERROR: (gcloud.alpha.compute.ssl-certificates.create) Unable to read file
(—–BEGIN CERTIFICATE—–mycertificate—–END CERTIFICATE—–): (Errno 36) File name too long: ‘—–BEGIN CERTIFICATE—–mycertificate—–END CERTIFICATE—–‘.

I got the command from the GUI on the page
https://console.cloud.google.com/net-services/loadbalancing/advanced/sslCertificates
generated. While generating there is still a typo, –priavteKey is used instead of the correct –private-key. I have changed this manually in my command.
I can see this problem is in the stable, beta and alpha version of the command gcloud “compute ssl-certificates create”.
Am I doing something wrong, or could this be a bug either in generating the command from GUI or read the parameter data from command?

For this post I’ve created a self singed certificate and used it’s data, so the private key is not confidential. This is the complete glocud command that I used:

gcloud compute ssl-certificates create certificate-rsa2048 --project=my-project --global --certificate=-----BEGIN CERTIFICATE-----$'n'MIIDDzCCAfegAwIBAgIUZbQ2aFWcrxsv3y7a6QLGqQ1vBJkwDQYJKoZIhvcNAQEL$'n'BQAwFzEVMBMGA1UEAwwMbGludXgtc2VydmVyMB4XDTIwMDkxMzE1MTcyNVoXDTIx$'n'MDkxMzE1MTcyNVowFzEVMBMGA1UEAwwMbGludXgtc2VydmVyMIIBIjANBgkqhkiG$'n'9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQiXzzqMwNEhzuc20R4K4IM6IDaPS2THacCz$'n'2j0DSRAkmospS4a3lLbQ1Hcn8kGXB/fWCYPq7n/UWQww5gQYX3KLrqSh696CH8mJ$'n'receaZ1fAp8hXEbGuELQoFhD68kAyPGP7NvpthYRmp/Ydxw4U3nk2XzfuiLtUo3R$'n'WzFdJMYIzQd2A5V+CAs/juIVegB0hYTryqMwiDkz4xhn1B4kJPDBsf3kPXM2leKg$'n'DEZy8PdhcF2RlM/1+lN5F/3rm17iAgYxqZrSAFSWcg7KMRjWXegi8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