     
     // Check if the handshake failed
     guard rc == 0 else {
-      let errMsg = "handshake failed: " + String(UTF8String: strerror(errno))!
+      let errMsg = "Handshake failed: " + String(UTF8String: strerror(errno))!
       println(errMsg)
       
-      throw ClientError.HandshakeFailed(errMsg)
+      throw SwiftSSH2Error.AuthenticationFailed(errMsg)
     }
     
     // Grab the server fingerprint if possible

    
    // No valid socket was found
    guard sock != -1 else {
      throw ClientError.UnableToOpenConnectionToServer
    }
    
    return sock

  public func authorizeWithCredentials(session: SSH2Session) throws -> SFTPSession {
    // Check if we have username and passowrd
    guard let username = self.username, password = self.password else {
      throw SwiftSSH2Error.AuthenticationFailed("Cannot authorized without a valid username and password.")
    }
    
    var rc: Int32 = 0
