fix ssl certificate check