riboseinc / digicert

Ruby bindings for the Digicert Services API
https://www.digicert.com/services/v2/documentation
MIT License
8 stars 10 forks source link

Fix SSL EV Plus duplication issue #145

Closed abunashir closed 6 years ago

abunashir commented 6 years ago

Currently, the duplication for SSL EV Plus request throws an Invalid DNS name issue. After looking into this we found this interface does not expect us to provide both root and www in the same request, otherwise it won't process that request.

This commit adds simple fix, and it will remove www. from the dns_names list and this should fix the issue for now.

Fixes: #135

ronaldtse commented 6 years ago

@kwkwan could you help check if this solves the problem? Thanks!

kwkwan commented 6 years ago

As the certificate is EV SSL certificate, we should select dns_name starts with “www.” instead of removing it.

dns_names.select{|dns_name| dns_name.match(/^(www.)/) }

Otherwise, it will cause error

order = Digicert::OrderDuplicator.create(order_id: order_id)
Digicert::Errors::RequestError: [{"code"=>"invalid_dns_name_on_duplicate", "message"=>"Invalid DNS name on duplicate request. The DNS names must match what was on the original order."}]
abunashir commented 6 years ago

@kwkwan I'm not sure about the complete scenario for other types of duplication or reissue, but I've modified the regex a bit so it selects any subdomains except the root domains, and please let me know if that fixes the issues. Thanks!

abunashir commented 6 years ago

@kwkwan: Merging it for now, but please check it out whenever you have a chance and if necessary then I will add the necessary changes, Thanks!

kwkwan commented 6 years ago

@abunashir It looks fine. Thanks.