]> git.netwichtig.de Git - user/henk/code/ruby/macir.git/commitdiff
initial commit – get LE’s newAccount uri
authorHendrik Jäger <gitcommit@henk.geekmail.org>
Tue, 23 Jan 2024 19:37:42 +0000 (20:37 +0100)
committerHendrik Jäger <gitcommit@henk.geekmail.org>
Tue, 23 Jan 2024 19:37:42 +0000 (20:37 +0100)
macir.rb [new file with mode: 0644]

diff --git a/macir.rb b/macir.rb
new file mode 100644 (file)
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
+