Skip to content

Instantly share code, notes, and snippets.

@danajp
Created May 23, 2017 18:47
Show Gist options
  • Save danajp/dc4a55851163ad554a614b38e9c075f2 to your computer and use it in GitHub Desktop.
Save danajp/dc4a55851163ad554a614b38e9c075f2 to your computer and use it in GitHub Desktop.
[net http blog] irb net http
irb(main):130:0> Net::HTTP.start(
irb(main):131:1* "k8s.dev.use1.int.greenhouse.io",
irb(main):132:1* 443,
irb(main):133:1* :use_ssl => true,
irb(main):134:1* :cert => OpenSSL::X509::Certificate.new(File.read("/home/dana/.kube/k8s-admin.pem")),
irb(main):135:1* :key => OpenSSL::PKey.read(File.read("/home/dana/.kube/k8s-admin-key.pem")),
irb(main):136:1* ) do |http|
irb(main):137:1* http.request(Net::HTTP::Get.new("/version"))
irb(main):138:1> end
=> #<Net::HTTPUnauthorized 401 Unauthorized readbody=true>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment