SSLSocket Connecting Outbound

I’m trying to send text message (HL7 messages to be specific) over TCP using SSL. I’ve created an Inbound application to receive the message and I’m using an SSLSocket with a certificate file, setting SSLEnabled = true, SSLConnectionType = TLSv12. I set the inbound Port number and get the port to listen.

I then have an Outbound application that needs to write messages to the Inbound application. So I have an SSLSocket, set the port and address, SSLEnabled=true, SSLConnectionType=TLSv12 and try to connect. When I connect, the IsConnected flag is true, but the SSLConnected = false, SSLConnecting = false, and if I try to write to the port, I get encrypted data at the Inbound application.

What am I doing wrong? Should I be setting a client certificate file on the outbound application?

Any ideas would be appreciated.

What port are you trying to use. I know for certain that Mac applications cannot use “Well known ports” without special permission. Well known being anything less than 1024.

For SSL (ok TLS) you are going to have to have a certificate to enable the encryption to work correctly. The sending side is going to need at least the private key and the receiver at least the public key.

https://documentation.xojo.com/api/networking/sslsocket.html#notes

@Ian_Kennedy Surely I need the private key at the receiver and the public key at the sender? And am I using the SSLSocket.CertificateFile for both sides? The documentation states that you must specify a certificate file for the listener.

You can use MBS Xojo CURL Plugin with CURLSMBS class.

Basically you set ConnectOnly option to 1.
Using e.g. a HTTPS URL.

Then you would connect only with SSL and you can use SendData to send or ReceiveData to read.

Yes, you’re correct. My mistake.