[TLS] Issue #22: Fix for endpoint checking and setting.