BlueSSLService icon indicating copy to clipboard operation
BlueSSLService copied to clipboard

Documentation example showing a TLS client needed

Open ianpartridge opened this issue 7 years ago • 4 comments

It's possible to use BlueSSLService and BlueSocket to write a client socket that talks over TLS.

To do this you create a BlueSSLService.Configuration() passing no parameters, then create an SSLService from that, then set your socket's delegate and call connect().

It would be good to have an example in the README showing this. Currently, although it's mentioned, all the code samples involve using BlueSSLService.Configuration to load a certificate from disk.

It would be nice to have a simple example showing how BlueSSLService can be used to create a TLS client socket.

ianpartridge avatar Jan 10 '19 15:01 ianpartridge

Sure, I’ll see what I can come up with.

billabt avatar Jan 10 '19 17:01 billabt

Hello, I tried to use this code

let configuration = SSLService.Configuration()
socket.delegate = try SSLService(usingConfiguration: configuration)

And I have error 'init(withCipherSuite:clientAllowsSelfSignedCertificates:)' is unavailable: This API not supported on Apple platforms.

Can I use BlueSocket like a socket client on the Mac? How I understand without SSLService the socket will connect and send messages without encryption.

sglushchenko avatar Jan 11 '19 10:01 sglushchenko

Interesting. @billabt this should be possible right?

ianpartridge avatar Jan 11 '19 10:01 ianpartridge

@ianpartridge @billabt I think "should", I think the Kitura should work same on Mac and Linux. Maybe just need an example

sglushchenko avatar Jan 11 '19 10:01 sglushchenko