问题描述
我正在应用程序中使用上载图像的功能。应用程序使用SOAP请求将图像发送到服务器。最近,我将网址从http设置为https,并且遇到了这个问题,
任务。 HTTP加载失败,0/0字节(错误代码:-1200 [3:-9858])
我已经尝试了info.plist中的所有更改,但无法正常工作。请你帮助我好吗? 谢谢
解决方法
好,看看这个...
if ([challenge.protectionSpace.authenticationMethod
isEqualToString:NSURLAuthenticationMethodServerTrust])
[challenge.sender useCredential:[NSURLCredential
credentialForTrust:challenge.protectionSpace.serverTrust]
forAuthenticationChallenge:challenge];
[challenge.sender
continueWithoutCredentialForAuthenticationChallenge:challenge];
我认为应该是
if ([challenge.protectionSpace.authenticationMethod
isEqualToString:NSURLAuthenticationMethodServerTrust])
[challenge.sender useCredential:[NSURLCredential
credentialForTrust:challenge.protectionSpace.serverTrust]
forAuthenticationChallenge:challenge];
else // you need to add an else here
[challenge.sender
continueWithoutCredentialForAuthenticationChallenge:challenge];
编辑
此外,我看到您将网址指定为
https://pro-ap.com.au/Mobile/profilepic.asmx?
删除最后一个问号,因为它是请求的一部分,并将在构建请求时自动添加。