开发者

Check if a web server is https certificated or not?

开发者 https://www.devze.com 2023-03-04 14:35 出处:网络
does annyone knows how i can check if a web server if certificated or not. in my code im using this: [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[[NSURL URLWithString: urlAddress] host]];

does annyone knows how i can check if a web server if certificated or not. in my code im using this:

[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[[NSURL URLWithString: urlAddress] host]];

But this accepts all the certificates.. but i wanna know if a web server is certificated or not.. if its not then i want to allow it开发者_高级运维 so im basicly looking for an IF statement

Ty already,


The obvious answer would be not to use that method (which is undocumented and therefore technically out of bounds anyway).

The proper way to handle communication to a site with a self signed certificate is for the user to install the certificate and explicitly set its trust settings.


there is sample application in dev center about using certificates

0

精彩评论

暂无评论...
验证码 换一张
取 消