Warm tip: This article is reproduced from serverfault.com, please click

Create a .crt for android

发布于 2020-12-03 21:19:59

I want to create a .crt file which is going to trust https when I use fiddler on my phone. I find few site but they generate .cert and not .crt.

And there content are like this

-----BEGIN CERTIFICATE-----
MIICzzCCAbegAwIBAgIJALgjZQpOGGEAMA0GCSqGSIb3DQEBBQUAMBgxFjAUBgNV
BAMTDTE5Mi4xNjguMi4xMTcwHhcNMjAxMjAzMDEwOTU1WhcNMzAxMjAxMDEwOTU1
WjAYMRYwFAYDVQQDEw0xOTIuMTY4LjIuMTE3MIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEA1qpC9Ofh1nS2/l/4g1AFCjR5KmIknL0lsOFCitOqxybCQzwP
x8Xe0Vp+/rRiwoGBkhi06RBUsDftvomZwIfCUvrYgDef4RiJeVsKX347uTl3SVxO
fCkWQm+/nV0eXLLApGRp5O1/vbqGvfs0o5ct2SBvdooQaIPcY/RFiwpydtYnep5V
9zZkyU1J6K5MnYowsBCxcx+BmA5bxroPTLl31/8TRdzW6Pye3o46Qkfj5Vut3v4M
AG3ZTqMvuAJ+eJl+4C+Oy0nT91ZDw7Kaw/FzaeAmpGAQY9Em9zZ3as1QRYoqY8eK
C8rXkx6iJH0pSgXGbug/f7zH/G/SYeUUwMQNZwIDAQABoxwwGjAYBgNVHREEETAP
gg0xOTIuMTY4LjIuMTE3MA0GCSqGSIb3DQEBBQUAA4IBAQCs+a+IKVyBAoaCz002
7lX02WAUo+QXgmTTUudw8fGOIKLpd1si4IT6+YHgiCFUx0scFsIYfvAgbXP9zbDa
/lWjHBnp98KkxCoP4tMnfQOmLMX5chc+EP+frg/uQOoQ8gaLAxONJGKYOmCbfb+2
TB+5jrZO3TmSUICgI99L8UMyfRy5kM2LbCo4ONteRpTHyIoB807n2eEiKdD9nWLq
sx4fwhY5ypqCyalCmd98iKJgV6P5jp0Hu4hAYyhckSlmvV98A6LJ0m3RECCwfxS7
O2s1+I+7o4ywCXR6pGs/rp6jKyq8JSk/iuSBHDfg70sgl9cyyyZLE0JItPVgDxVE
zucV
-----END CERTIFICATE-----

But this format isn't working. I need a .crt that's look like this

Thanks

Questioner
Justin Dupuis
Viewed
0
Hida 2020-12-06 01:44:36

That's pem(base64) encoded certificate and all you need is der(binary) encoded. You can use openssl to convert it:

     openssl x509 -outform der -in <yourcert.crt> -out <out.crt>

No matter with extension. You can rename with .cer .der .pem or .crt as you need.