引言
之前公司为网站端配置了SSL证书,上午刚好有空就做了下iOS端的支持,随便记录一下。
准备
获取Certification file
1 | openssl s_client -connect www.google.com:443 </dev/null 2>/dev/null | openssl x509 -outform DER > https.cer |
www.google.com:443换成你自己的地址。当然网管有的话直接向他索取就好了。如果格式是.crt可以通过下面的代码转成.cer
1
openssl x509 -in https.crt -out https.cer -outform der
这里顺便提供一些其他格式转化的例子。具体可以看这里