Android 和 ASP.NET MVC HTTPS 连接超时
我正在尝试连接到使用安全连接的 Web 服务。该服务是在 asp.net MVC 3 中构建的,并使用自签名证书。
在设备端,我按照此处接受的解决方案创建了连接,但 HttpDefaultClient 执行
方法抛出 IOException 表示操作超时。
在服务器端,我将控制器操作创建为:
// driver for testing incoming requests from mobile devices
[RequireHttps(Order = 1)]
[HttpPost]
public JsonResult CollectClientInfo( FormCollection formCollection )
{
// get form values
// do stiff with form data
// build result
Distionary<string,string> result = new Dictionary<string,striing.();
result.Add("memberID", clientID );
result.Add( "statusCode", statusCode.ToString() );
result.Add("message", message);
result.Add("total", total.ToString(CultureInfo.CreateSpecificCulture("en-CA")));
return Json(result);
}
我可以让它通过 HTTP 工作,但问题是保护连接。除了安装证书或上面的代码之外,asp.net 或 MVC(或两者)中是否有一些设置来处理安全连接?
I am trying to connect to a web service that uses a secure connection. The service is built in asp.net MVC 3 and uses a self signed certificate.
On the device side, I have created the connection following the accepted solution here, yet the HttpDefaultClient execute
method is throwing an IOException saying the operation timed out.
On the server side, I have created the controller action as:
// driver for testing incoming requests from mobile devices
[RequireHttps(Order = 1)]
[HttpPost]
public JsonResult CollectClientInfo( FormCollection formCollection )
{
// get form values
// do stiff with form data
// build result
Distionary<string,string> result = new Dictionary<string,striing.();
result.Add("memberID", clientID );
result.Add( "statusCode", statusCode.ToString() );
result.Add("message", message);
result.Add("total", total.ToString(CultureInfo.CreateSpecificCulture("en-CA")));
return Json(result);
}
I can get this to work over HTTP, but the issue is securing the connection. Is there some set up in in asp.net or MVC (or both) to handle secure connections other than installing a certificate or the code above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其谎言在于深入Windows防火墙并设置规则以允许来自客户端的安全连接。我应该先看看最简单的解决方案。
The lied in digging into the windows firewall and setting a rule to allow secure connections from the client. I should have looked at the simplest solution first.