summaryrefslogtreecommitdiff
path: root/macir.rb
blob: 0bc2382620294b5c145db5d7cf37052f67b0d283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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