xcode - Different results for SecTrustEvaluate for one certificate for different policies -


I do not understand what's going on in the situation (AFSAcurity Policy. M, AFPOLICKEY FOR CERTIFICATE FUNCTION, AFNetwork Framework): Policy = SecPolicyCreateBasicX509 (); AF_Require_noErr (SecTrustCreateWithCertificates (tempCertificates, Policy, and Allowed Trust), _out); AF_Require_noErr (SecTrustEvaluate (Allowed Trust, and Results), _out); // result = 5 (KSCTRRRRR reserveable refreshfileer) // different policy policy = secolicy ssl (true, (__brry CF stringerf) @ "www.MySite.com"); AF_Require_noErr (SecTrustCreateWithCertificates (tempCertificates, Policy, and Allowed Trust), _out); AF_Require_noErr (SecTrustEvaluate (Allowed Trust, and Results), _out); // result = 4 (KSECTRRUURU) is specified

The certificate is valid and the deadline is not signed. Signature algorithm SHA-1 Why returned kSecTrustResultRecoverableTrustFailure and Do not return kSecTrustResultUnspecified for SecPolicyCreateBasicX509 .

please read

SecTrustEvaluate function certification certificate of your certificate Certifying the Certificate of Certificates certificates certify by certifying the anchor certificate, according to the policy or policies included in the Trust Management object.

As a rule, you should manage different return values ​​in such a way:

  • KSecTrustResultUnspecified รข € "Evaluation Any Assessment Successfully reached an (unclear dependable) anchor certificate without failures, but never explicitly said user-confidence preference was encountered. This is the most common return value.
  • KSecTrustResultRecoverableTrustFailure A "This means that You should not rely on the form of the series, but rather that the series can be trusted with some minor changes in the context of evaluation, such as ignoring expired certificates or adding an additional anchor to the set of trusted anchors. .

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -