iPhone 使用 SSL 登录网站

标签 iphone ios5 ssl

我在从 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];

如果您需要更多信息,请询问。 我对任何帮助都很满意。

你好。

最佳答案

服务器 www.remote.sokratherm.de 似乎没有在端口 80 上使用 SSL 运行。您是要指定该端口吗?如果不是,请从您的请求 URL 中删除 :80

关于iPhone 使用 SSL 登录网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12037114/

相关文章:

iphone - 无法摆脱 UITableView 的 tableFooterView 中的颜色

iphone - 在 iPhone 上使用 Quartz 绘制虚线

UITableView 在不使用编辑按钮的情况下启动行重新排列

ios - 我们如何在 ARC 中显式调用垃圾收集器?还有一种方法可以决定何时释放 ARC 中的内存?

java - 在 java 中禁用了 SSLv3 但在 javamail API 中 ssl 有效吗?

使用 NSURLConnection 的应用程序的 iPhone 自定义 CA 证书?

ios - 将项目从其他数组添加到 NSArray 时出现问题

iphone - 使用个人存储库向 Cydia 提交付费应用程序 - 可能吗?

ios - 用简单的英语解释 NSIncrementalStore

ssl - Traefik IngressRoute 不接受 TLS 证书