             return errSSLWouldBlock
         case EPIPE:
             return errSSLClosedAbort
-    }
-
+    }*/
     return errSecIO
-}*/
+}
+ 

        }
    }

    /*
    func connectSSL() throws {
        var context: SSLContextRef = SSLCreateContext(nil, kSSLClientSide, kSSLStreamType)
        if context == nil {
            return try? NWErrorUtil.noWithErrorCode(kNWErrorSSLContext)!
        }
        var setio: OSStatus = SSLSetIOFuncs(context, NWSSLRead, NWSSLWrite)
        if setio != errSecSuccess {
            return try? NWErrorUtil.noWithErrorCode(kNWErrorSSLIOFuncs, reason: setio)!
        }
        var setconn: OSStatus? = SSLSetConnection(context, (Int(self.socket) as? SSLConnectionRef))
        if setconn != errSecSuccess {
            return try? NWErrorUtil.noWithErrorCode(kNWErrorSSLConnection, reason: setconn)!
        }
        var setpeer: OSStatus = SSLSetPeerDomainName(context, self.host.utf8, strlen(self.host.utf8))
        if setpeer != errSecSuccess {
            return try? NWErrorUtil.noWithErrorCode(kNWErrorSSLPeerDomainName, reason: setpeer)!
        }
        var setcert: OSStatus? = SSLSetCertificate(context, ([self.identity] as? CFArrayRef))
        if setcert != errSecSuccess {
            return try? NWErrorUtil.noWithErrorCode(kNWErrorSSLCertificate, reason: setcert)!
        }
        self.context = context
        //return true
    }

    func handshakeSSL() throws {
        var status: OSStatus = errSSLWouldBlock
        var i = 0

//  Copyright (c) 2012 noodlewerk. All rights reserved.
//
import Foundation

extension String {
    var length: Int {
        return characters.count
    }
    
    public var cString: UnsafeMutablePointer<Int8> {
        return UnsafeMutablePointer<Int8>(mutating: NSString(string: self).utf8String)!
    }
}

/** An SSL (TLS) connection to the APNs.

 This class is basically an Objective-C wrapper around `SSLContextRef` and `SSLConnectionRef`, which are part of the native Secure Transport framework. This class provides a generic interface for SSL (TLS) connections, independent of NWPusher.
