简体   繁体   中英

Alamofire Framework and iOS Certificate issue

I have two iOS dev accounts. I use my dev account to make tests. After finishing the development I decided to change the project certificate and set it to client's Apple Dev account.

When I use the first one (my Apple account), the requests are made through Alamofire return what expected. But when I set the second certificate I always get errors such as 401 Unauthorized Error. I think it sends irrelevant data to the server.

When I use the built in NSURLSession framework, it works fine on both Apple Dev accounts. So it is related with certificates and Alamofire but couldn't find the problem for days.

I've tried ServerTrustPolicy for Alamofire instance but didn't help. Also I've set App Transport Security Settings in the info.plist file, that didn't help as well.

Is there anyone who has experienced this problem? Thanks.

After trying many things, finally I've decided to clear the XCode cache and now it works without any problem. And lesson learned; you should clear cache if you switch between Teams (Apple Dev Accounts) in XCode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM