check only if connection is encrypted