From a15d47be69e5b6adea4f542531130fe7ba33c321 Mon Sep 17 00:00:00 2001 From: Hendrik Jäger Date: Tue, 23 Jan 2024 20:37:42 +0100 Subject: initial commit – get LE’s newAccount uri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- macir.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 macir.rb diff --git a/macir.rb b/macir.rb new file mode 100644 index 0000000..0bc2382 --- /dev/null +++ b/macir.rb @@ -0,0 +1,26 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'json' + +acme_directory_uri = URI('https://acme-staging-v02.api.letsencrypt.org/directory') +acme_directory_uri.freeze +hostname = acme_directory_uri.hostname +path = acme_directory_uri.path +port = acme_directory_uri.port + +acme_directory_json = Net::HTTP.get(acme_directory_uri) +acme_directory = JSON.parse(acme_directory_json) +pp acme_directory + +newAccount_uri = acme_directory['newAccount'] +p newAccount_uri + + +# Net::HTTP.get(hostname, '/index.html') +# Net::HTTP.start(hostname) do |http| +# http.get('/todos/1') do |res| +# p res +# end +# end + -- cgit v1.2.3