{"id":19032469,"url":"https://github.com/creadone/zerossl","last_synced_at":"2025-04-23T16:41:05.909Z","repository":{"id":56899322,"uuid":"397463360","full_name":"creadone/zerossl","owner":"creadone","description":"Ruby client for ZeroSSL","archived":false,"fork":false,"pushed_at":"2021-08-18T03:44:22.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T23:16:36.671Z","etag":null,"topics":["client","ruby","ssl","zerossl"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creadone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-18T03:41:28.000Z","updated_at":"2023-03-05T00:55:52.000Z","dependencies_parsed_at":"2022-08-20T17:30:10.095Z","dependency_job_id":null,"html_url":"https://github.com/creadone/zerossl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fzerossl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fzerossl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fzerossl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fzerossl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creadone","download_url":"https://codeload.github.com/creadone/zerossl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472023,"owners_count":21436067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","ruby","ssl","zerossl"],"created_at":"2024-11-08T21:28:48.330Z","updated_at":"2025-04-23T16:41:05.889Z","avatar_url":"https://github.com/creadone.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZeroSSL\n\nRuby client to obtain SSL certificate from [ZeroSSL](https://zerossl.com) via [REST API](https://zerossl.com/documentation/api/)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'zerossl'\n```\n\nAnd then execute:\n```ruby\n$ bundle install\n```\nOr install it yourself as:\n```ruby\n$ gem install zerossl\n```\n## Usage\n\n```ruby\nrequire 'zerossl'\n\n# Setup gem\nZeroSSL::Setup.config.access_key = '123456789'\nclient = ZeroSSL::Client.new\n\n# Define domain and server html path\ndomain_name    = 'umbrella.llc'\nhtml_directory = '/var/www/html'\n\n# Set Certificate Signing Request options\ncsr_opts = {\n  common_name:  domain_name,\n  organization: 'Umbrella',\n  country:      'RU',\n  state_name:   'Moscow',\n  locality:     'Moscow'\n}\n\n# Build CSR\ncsr, key = ZeroSSL::CSR.new(csr_opts).call\n\n# Build certificate request\nrequest = {\n  certificate_domains:        [domain_name],\n  certificate_validity_days:  ZeroSSL::VALIDITY_DAYS::DAY90,\n  certificate_csr:            csr\n}\n\n# Receive request, extract certificate id and validation details\nresponse       = client.create(request).body\ncertificate_id = response['id']\nother_methods  = response['validation']['other_methods']\n\n# Write validation content into file to the server directory\nother_methods.each do |domain_name, validation_types|\n  validation_uri     = URI(validation_types['file_validation_url_http'])\n  validation_content = validation_types['file_validation_content']\n\n  File.open(File.join(html_directory, validation_uri.path), 'w') do |io|\n    io \u003c\u003c validation_content.join(\"\\n\")\n  end\nend\n\n# Tell ZeroSSL domain are ready for validation\nclient.verify(certificate_id, ZeroSSL::VALIDATION_TYPE::HTTP)\n#=\u003e { [...] validation =\u003e { other_methods =\u003e { \u003cdomain\u003e =\u003e file_validation_url_http }}}\n\n# Check validation status\nclient.status(certificate_id)\n#=\u003e true\n\n# Download Certificate (inline)\nclient.download(certificate_id)\n#=\u003e {\n#    \"certificate.crt\": \"---BEGIN CERTIFICATE---{primary_certificate}---END CERTIFICATE---\",\n#    \"ca_bundle.crt\": \"---BEGIN CERTIFICATE---{certificate_bundle}---END CERTIFICATE---\"\n# }\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/creadone/zerossl.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fzerossl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreadone%2Fzerossl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fzerossl/lists"}