我从 Iphone 应用程序登录网站时遇到问题。它是一个 https,因此是一个 SSL 安全站点。不幸的是,当我尝试登录时收到一条错误消息。而且我不知道如何解决这个错误。
这里的错误信息:
2012-08-20 13:38:56.490 Login_2[330:f803] IN GETFILELIST: (null)
2012-08-20 13:38:56.903 Login_2[330:f803] ERROR: (null)
2012-08-20 13:38:56.914 Login_2[330:f803] ERROR!:
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x6ab9ac0 {NSErrorFailingURLStringKey=https://www.remote.sokratherm.de:80/?content=tableau&tableau=1, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://www.remote.sokratherm.de:80/?content=tableau&tableau=1, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSUnderlyingError=0x6abea00 "An SSL error has occurred and a secure connection to the server cannot be made."}
这里的代码:
NSString *apiPath = [NSString stringWithFormat:@"https://%@:%@/", hostServer, hostPort];
httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:apiPath]];
[httpClient setAuthorizationHeaderWithUsername:hostUser password:hostPass];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:@"index.php" parameters:nil];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
如果您需要更多信息,请询问。我很高兴有任何帮助。
问候。