开发者

Securing already connected java sockets with SSL?

开发者 https://www.devze.com 2023-02-07 23:22 出处:网络
I have already connected sockets on server and client side and I want to know if it is possible to secure this connection with ssl in java somehow with SSLContext?

I have already connected sockets on server and client side and I want to know if it is possible to secure this connection with ssl in java somehow with SSLContext?

I know that client side sockets can be secured like this(with SSL). But i am not sure about connected sockets on server side?

Thanks for y开发者_JS百科our help..


Yes, it is possible on the server side. The SSLSocketFactory class has a createSocket() method just for this purpose. Once you return from the ServerSocket.accept() method you have a normal Socket that you can layer an SSLSocket on.

0

精彩评论

暂无评论...
验证码 换一张
取 消