简体   繁体   English

安全插座连接

[英]Secure socket connection

I'm working on a school project with a server application that holds centralized data, and client applications that hold cached data that will be synchronized with sockets. 我正在开发一个学校项目,其中包含一个包含集中数据的服务器应用程序,以及包含将与套接字同步的缓存数据的客户端应用程序。 Everything is written in Java. 一切都是用Java编写的。

What is good practice? 什么是好习惯? How can I stop people from listening to my traffic? 如何阻止人们收听我的流量? Or prevent people to understand what is said? 或者阻止人们理解所说的内容?

You simply use SSLSocketFactory instead of SocketFactory for your client server application. 您只需为客户端服务器应用程序使用SSLSocketFactory而不是SocketFactory。 That way, the communication between the two will be totally encrypted. 这样,两者之间的通信将被完全加密。 You can secure your client server app in less than a day, if you know basic Java. 如果您了解基本Java,则可以在不到一天的时间内保护客户端服务器应用程序。 Here's a tutorial . 这是一个教程

SSL is the standard practice. SSL是标准做法。 See the javax.net.ssl package, and the JSSE Reference Guide . 请参阅javax.net.ssl包和JSSE参考指南 But this may be beyond the scope of your project or your abilities at this stage. 但这可能超出了您的项目范围或您现阶段的能力。 Check with your instructor. 请咨询教练。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM