Created
May 23, 2017 18:47
-
-
Save danajp/dc4a55851163ad554a614b38e9c075f2 to your computer and use it in GitHub Desktop.
[net http blog] irb net http
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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