Fixing improper certificate validation security vulnerability