在infoplist里设置以下字段
NSAppTransportSecurity —Dictionary
NSAllowsArbitraryLoads — Boolean YES
基于TLS 1.2版本协议。然后证书的加密的算法还需要达到SHA256或者更高位的RSA密钥或ECC密钥,如果不符合,请求将被中断并返回nil.
NSAppTransportSecurity Dic
NSExceptionDomains Dic
baidu.com (对应网站设置加密) Dic
NSIncludesSubdomains YES
NSExceptionRequiresForwardSecrecy NO
NSExceptionAllowInsecureHTTPLoads YES