(PUP-3258) fix ENC issue with puppet apply

Rebased on stable, replaces #3118.