Does any have a example of using SwiftNIO and SwiftNIOSSL as a HTTPS client?
I am currently attempting to set up my client like-
let configuration = TLSConfiguration.forClient()
let sslContext = try SSLContext(configuration: configuration)
let sslHandler = try OpenSSLClientHandler(context: sslContext)
let handler = ...
let group = MultiThreadedEventLoopGroup(numThreads: 1)
let bootstrap = ClientBootstrap(group: group)
// Enable SO_REUSEADDR.
.channelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1)
.channelInitializer { channel in
channel.pipeline.add(handler: sslHandler).then {
channel.pipeline.addHTTPClientHandlers().then {
channel.pipeline.add(handler: handler)
}
}
}
However I am currently getting a handshake error with an error code of 335561744. Any help would be appreciated!