Securing already connected java sockets with SSL?
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.
精彩评论