{"id":322,"date":"2012-01-17T16:27:22","date_gmt":"2012-01-17T15:27:22","guid":{"rendered":"https:\/\/www.phillips321.co.uk\/?p=322"},"modified":"2012-01-17T16:29:13","modified_gmt":"2012-01-17T15:29:13","slug":"connecting-to-https-services-from-the-terminal","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2012\/01\/17\/connecting-to-https-services-from-the-terminal\/","title":{"rendered":"Connecting to HTTPS services from the terminal"},"content":{"rendered":"<p>A little brain issue prevented me from remembering how to connect to a HTTPS service on the command line. NetCat doesnt seems to work, it just hangs.<br \/>\nFortunately after wasting sometime i recalled how to do it in not one but 2 ways:<br \/>\nOption 1 : <strong>ncat<\/strong> (part of the nmap tool kit)<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"co4\">root@bt:~# <\/span>ncat <span class=\"re5\">--ssl<\/span> www.phillips321.co.uk <span class=\"nu0\">443<\/span><br \/>\nOPTIONS <span class=\"sy0\">\/<\/span> HTTP<span class=\"sy0\">\/<\/span><span class=\"nu0\">1.1<\/span><br \/>\nHost:www.phillips321.co.uk<br \/>\n<br \/>\nHTTP<span class=\"sy0\">\/<\/span><span class=\"nu0\">1.1<\/span> <span class=\"nu0\">200<\/span> OK<br \/>\nDate: Tue, <span class=\"nu0\">17<\/span> Jan <span class=\"nu0\">2012<\/span> <span class=\"nu0\">15<\/span>:<span class=\"nu0\">24<\/span>:<span class=\"nu0\">24<\/span> GMT<br \/>\nServer: Apache<span class=\"sy0\">\/<\/span>2.2.21 <span class=\"br0\">&#40;<\/span>Unix<span class=\"br0\">&#41;<\/span> mod_ssl<span class=\"sy0\">\/<\/span>2.2.21 OpenSSL<span class=\"sy0\">\/<\/span>1.0.0d PHP<span class=\"sy0\">\/<\/span>5.3.6<br \/>\nX-Powered-By: PHP<span class=\"sy0\">\/<\/span>5.3.6<br \/>\nVary: Accept-Encoding,Cookie<br \/>\nCache-Control: max-age=<span class=\"nu0\">3<\/span>, must-revalidate<br \/>\nWP-Super-Cache: Served supercache <span class=\"kw2\">file<\/span> from PHP<br \/>\nTransfer-Encoding: chunked<br \/>\nContent-Type: text<span class=\"sy0\">\/<\/span>html; <span class=\"re2\">charset<\/span>=UTF-<span class=\"nu0\">8<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Option 2 : <strong>openssl<\/strong> (part of the openssl tools)<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"bash codecolorer\">openssl s_client <span class=\"re5\">-connect<\/span> www.phillips321.co.uk:<span class=\"nu0\">443<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><em>Be warned though, using the openssl was will echo out all the certificate details&#8230;.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A little brain issue prevented me from remembering how to connect to a HTTPS service on the command line. NetCat doesnt seems to work, it just hangs. Fortunately after wasting sometime i recalled how to do it in not one but 2 ways: Option 1 : ncat (part of the nmap tool kit) 12345678910111213root@bt:~# ncat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[75,128,129,41],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/322"}],"collection":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":2,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/322\/revisions\/324"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}