If this error occurs when you're trying to create a mirror, check this points:
- Restore backup at secondary server has to be with NORESTORE option.
- All log backup must be restored (Probably some job of SQL SERVER AGENT makes Transaction Log Backup, ensure that last log backup is restored in secondary too).
- GRANT CONNECT ON ENDPOINT::Mirroring TO Public (I think with domain user that runs service account it's enough, but it doesn't work for me, so, PUBLIC, works).
- Maybe Firewall block the Port Number, try to connect, with TELNET for example.
I hope it helps.