1 概述
SSL certificates are required for running web sites using the HTTPS protocol.
當你訪問某個網站時出現 security warning 說明 SSL 證書沒有簽名或者不被手機允許
Android has default trusted certificate authority (or call “system trusted credential” ) preinstall in the phone.
手機中查看預置證書
證書格式以及後綴名
Certificate 格式 | 後綴 | 格式鑑別方式 | 用戶安裝支持 | 系統默認支持 |
---|---|---|---|---|
PEM | .pem / .crt /.cer /.key | Base64 encoded certificate ASCII files contain"-----BEGIN CERTIFICATE-----" and"-----END CERTIFICATE-----" statements | .crt和.cer格式支持 | MD5/SHA1 filenaming. 支持(65445551d.0) |
DER | .der /.cer /.crt | binary DER form. no BEGIN/END statements | .crt和.cer格式支持 | NO |
PKCS#7P7B | .p7b .p7c | Base 64 ASCII format contain"-----BEGIN PKCS7-----" and"-----END PKCS7-----" statements | No | No |
PKCS#12PFX | .pfx .p12 | binary format. | .p12 和.pfx 支持 | No |
2 預置方法
下載相應的.pem文件,然後在linux系統中通過執行以下命令將.pem轉換成.0文件
(1)openssl x509 -subject_hash_old -in PCA_2_G6.pem
可以得到.0文件的head,比如0708417d
(2)cat PCA_2_G6.pem > 0708417d.0
可以得到0708417d.0文件
2.將0708417d.0文件複製到/system/ca-certificates/files文件夾中
3.重新build這個工程
4.開機以後通過Settings->Sercurity&location->Encryption&credentials->Trusted credentials->system/user可以查看預置的證書