lib/r509/certificateauthority/http/server.rb in r509-ca-http-0.2.1 vs lib/r509/certificateauthority/http/server.rb in r509-ca-http-0.2.2
- old
+ new
@@ -128,9 +128,14 @@
raise ArgumentError, "Must provide a subject"
end
if params.has_key?("extensions") and params["extensions"].has_key?("subjectAlternativeName")
san_names = params["extensions"]["subjectAlternativeName"].select { |name| not name.empty? }
+ elsif params.has_key?("extensions") and params["extensions"].has_key?("dNSNames")
+ san_names = R509::ASN1::GeneralNames.new
+ params["extensions"]["dNSNames"].select{ |name| not name.empty? }.each do |name|
+ san_names.create_item(:tag => 2, :value => name.strip)
+ end
else
san_names = []
end
validity_period = validity_period_converter.convert(params["validityPeriod"])