BlueSSLService icon indicating copy to clipboard operation
BlueSSLService copied to clipboard

BlueSSLService client cannot connect to stunnel server on windows

Open JackyBaby615 opened this issue 6 years ago • 1 comments

JackyBaby615 avatar Jun 19 '19 09:06 JackyBaby615

I want to connect to stunnel server on windows by using this BlueSSLService client. But I get an error when I create Socket with SSLService Delegate and connect to stunnel. This is my function for creating client tls socket ` func createStealthSocket() -> Socket?{

    var myConfig = SSLService.Configuration(withChainFilePath: self.cert, withPassword: "ghostman", usingSelfSignedCerts: true, clientAllowsSelfSignedCertificates: true)
    myConfig.cipherSuite = "ALL"
    do {
        let socket = try Socket.create(family: .inet)
        socket.delegate = try SSLService(usingConfiguration: myConfig)
        try socket.connect(to: self.tunnelHost, port: Int32(self.tunnelPort))
        return socket
    } catch let error {
        guard error is Socket.Error else {
            print("Unexpected error...")
            return nil
        }
    }
    return nil
}

` When i run this function, i get a normal return value without error. After that i write data from this returned socket but if i capture a network packet with wireshark, i get an encrypted alert (21). Below is the log taken from wireshark. err

I would be grateful if you can help me out what the error is.

JackyBaby615 avatar Jun 19 '19 10:06 JackyBaby615