user3139545
user3139545

Reputation: 7394

Connecting to external SSL TCP socket what does it really mean?

I'm writing a small app that is connecting to a socket on a server I don't know the implementation details of. In the documentation of the socket it says:

All communication on the socket is using SSL

When I try to figure out what is required by the client to be able to communicate over SSL I get very confused because SSL requires details about key stores and certificates.

All I have access to is the host address and the socket port and this should be enough according to the server owners.

My question is how can a socket use SSL but there is no requirements of the client to provide certificates etc. (which the SSL standard seems to require)?

How do I know what is required to setup on the client to connect to a SSL socket?

The language I'm using is Java/Scala and I'm required to provide SSLContext which will be used to create a SSLEngine.

This is the naive way I tried which does not work.

val sslContext = SSLContext.getDefault()

How would a minimal example look for configuring SSLContext and generating a SSLEngine for the use case I'm looking at?

Upvotes: 0

Views: 160

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123491

All communication on the socket is using SSL

If this is all what is known about the server than it is probably using a certificate from a well established CA issued to the hostname of the server. In this case you will find lots of examples in several programming languages on how to create a SSL client with such a server.

If this assumption is not correct and the examples don't work you need more details about the server, i.e. about the certificates used, the ciphers used, TLS protocol spoken etc. And then you can adapt your program to these requirements.

To expand the answer after you've provided details about the programming language you are using: Searching for scala ssl client example gives you lot of information which help you start.

Upvotes: 1

Related Questions