Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am new to SSL/HTTPS so uncertain on the basics.

PROBLEM: A Java applet must communicate with a socket server listening on a port on the web server. Also communication must be secure.

Without SSL, the Java applet can make a direct socket communication to the server port (running on the web server).

But if communication must be encrypted using SSL, then how will the Java client communicate with the socket server?

My confusion is that the Java client will need to communicate with the HTTPS port (which is presumably connecting to a web server). But then how does the communication channel get 'split off' to communicate with the custom socket server? How would the ssl client specify the custom port in the message?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

My confusion is that the Java client will need to communicate with the HTTPS port ...

Your confusion is that you're confusing SSL, an encrypted network communication protocol, with HTTPS...which is HTTP encrypted with SSL.

You can connect to any port with SSL. I don't know the Java API for it, but it's basically a wrapper to normal network communication that you call instead of raw network API, it's usually not much more complicated and just needs a few initial set-up calls made.

You'd specify the port in exactly the same manner as you do with your normal network API. It's going to essentially end up being an argument to your connection call.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.