Android客户端,HTTP服务器,我怎么知道客户端使用我的应用程序发送的数据?认证 [英] Android Client, Http Server, How do I know client is sending data using my app? authentication

查看:156
本文介绍了Android客户端,HTTP服务器,我怎么知道客户端使用我的应用程序发送的数据?认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户机/服务器数据传递所有正常工作。文字,图像等我的用户可以创建自己的Andr​​oid设备上的博客型岗位,并上传到我的服务器。所有使用HTTP多部分和输入/输出流完成。我的问题是 - 我怎么知道客户端实际上是我的应用程序,而不是一些脚本/其他黑客程序

I have client/server data passing all working correctly. Text, Images, etc. My users create blog-type posts on their android device, and upload to my server.. All is done using HTTP Multipart and Input/Output Streams. My issue is - How do I know the client is actually my app and not some script/other hacker app?

我要避免滥用的情况。

I want to avoid abuse scenarios.

  1. 在恶意用户A创建,发送相应的表格数据到我的服务器,并能垃圾邮件的服务器,创建恶意的帖子1000电脑脚本。
  2. 在恶意用户B创建一个简单的Andr​​oid应用程序发送相应的表格数据到我的服务器,他能垃圾邮件的服务器。
  3. 在恶意用户C标志到了我的服务,有效的帐户和密码,他修建垃圾使用PC脚本或Android应用程序服务器。

一个想法我是在频繁的职位等待时间服务器端强制prevent垃圾邮件。

One idea I have is to force a wait period server side on frequent posts to prevent spam..

但除此之外,我怎么能检查数据发送到我的服务器的人是

But beyond that, how can I check that the person sending data to my server is

  • 在Android设备和
  • 是运行我的应用程序发送表单数据,而不是其他。

我想避免SSL,因为我不希望通过所有这些注册与VeriSign,信任和去..

I want to avoid SSL as I don't want to register with Verisign, TRUST and go through all of that..

推荐答案

我终于得到了它所有的工作,服务器和客户端双向SSL认证。

I finally got it all working, server and client two-way ssl authentication.

我使用的指令在这里设置自己的证书颁发机构(CA) http://www.garex.net /阿帕奇/

I used the instructions here to setup my own cert authority (ca) http://www.garex.net/apache/

我跟着命令那里生成自己的CA,服务器和客户端的文件。

I followed the commands there to generate my own ca, server and client files..

大疑难杂症是创造客户端证书部分中,在garex.net链路使用1024大小的客户端密钥。事实证明,这是引发异常产生java.io.IOException:错误版本的密钥存储

The big "GOTCHA" was that in the "create client certificate" section, the garex.net link uses a 1024 size client key. As it turns out, this was throwing the exception java.io.IOException: Wrong version of key store

要解决上述的异常,我只使用512尺寸的按键。这是不包括1024参数OpenSSL的genrsa genkey命令来完成。

To get around the above exception, I had to use only 512 sized keys.. This is done by NOT including the "1024" parameter to the openssl genrsa genkey command..

最后,我想添加一个链接到一个工具,我结束了使用,而不是Portecle。我找到了密钥工具GUI程序在这里有很大的帮助,更容易比portecle之一来使用 - 的 http://www.lazgosoftware.com/kse/index.html

Finally I want to add a link to a tool I ended up using instead of Portecle.. I found the keytool gui program here of great help and easier to use than the portecle one - http://www.lazgosoftware.com/kse/index.html

这问题有点在一个痛苦的对接,所以我会密切关注这一主题。如果您遇到任何障碍随时回复..

This issue was a bit of a pain in the butt so I will keep an eye on this thread.. Feel free to reply if you run into any roadblocks..

这篇关于Android客户端,HTTP服务器,我怎么知道客户端使用我的应用程序发送的数据?认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆