diff --git a/lib/serverspec/type/x509_private_key.rb b/lib/serverspec/type/x509_private_key.rb index 1bb95686..87873c99 100644 --- a/lib/serverspec/type/x509_private_key.rb +++ b/lib/serverspec/type/x509_private_key.rb @@ -8,7 +8,7 @@ def valid? end def encrypted? - @runner.run_command("grep -wq \"^Proc-Type.*ENCRYPTED$\" #{name}").exit_status == 0 + @runner.run_command("grep -Ewq \"^(Proc-Type.*ENCRYPTED|-----BEGIN ENCRYPTED PRIVATE KEY-----)$\" #{name}").exit_status == 0 end def has_matching_certificate?(cert_file)