Fix Ping middleware when SSL is disabled