diff --git a/lib/serverspec/type/x509_certificate.rb b/lib/serverspec/type/x509_certificate.rb
index <HASH>..<HASH> 100644
--- a/lib/serverspec/type/x509_certificate.rb
+++ b/lib/serverspec/type/x509_certificate.rb
@@ -84,9 +84,9 @@ module Serverspec::Type
 
     # Normalize output between openssl versions.
     def normalize_dn(dn)
-      return subject unless subject.start_with?('/')
+      return dn unless dn.start_with?('/')
       # normalize openssl >= 1.1 to < 1.1 output
-      subject[1..-1].split('/').join(', ').gsub('=', ' = ')
+      dn[1..-1].split('/').join(', ').gsub('=', ' = ')
     end
   end
 end
Fixed infinite loop in subject of x<I>_certificate