Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request #59 from ruyrocha/feature/remove-certificates
Browse files Browse the repository at this point in the history
Remove SSL certificates
  • Loading branch information
itspriddle committed Nov 8, 2013
2 parents 6b6ed27 + 4aac8d9 commit 9b653d6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/lumberg/cpanel/ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ def uploadcrt(options = {})
api_function: "uploadcrt",
}.merge(options))
end

# Public: Removes a domain's SSL certificate. This function requires
# access to the 'sslinstall' feature
#
# options - Hash options for API call params (default: {})
# domain: String domain corresponding to the SSL certificate
# to remove
#
# Returns Hash API response
def remove(options = {})
perform_request({
api_version: 1, api_function: "delete", response_key: "data"
}.merge(options))
end
end
end
end
10 changes: 10 additions & 0 deletions spec/cpanel/ssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,15 @@ module Lumberg
host: domain)[:params][:data][0][:result].should eq(1)
end
end

describe "#remove" do
use_vcr_cassette "cpanel/ssl/remove"

subject { ssl.remove(domain: domain)[:params][:result] }

it "removes a certificate " do
subject.should include "The SSL host was successfully removed."
end
end
end
end
43 changes: 43 additions & 0 deletions spec/vcr_cassettes/cpanel/ssl/remove.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b653d6

Please sign in to comment.