If someone is coding a secure connection library, I'd have expected this to stick out like a red flag to them.
Why on earth would someone code logic like this (anyone working on it must have understood the basics enough to notice it was strange) without even querying it?