If you are looking for the epic motorcycle journey blog that I've written, please see the Miles By Motorcycle site I put together. 
  • Ian
    Testing an SSL connection from the command line
    03/11/2013 1:06PM

    I had a need recently to test an HTTPS connection from one remote location to another.  Not having a graphical browser available with which to test, I had to use a text-based tool. 'lynx' is a text-based browser that was available on the client end, but it does not support SSL. 'elinks' is lynx-like program, which DOES support SSL, but was not installed on the client side.

    Another option is to use 'openssl'.  Although it's not fancy, it will suffice to test an SSL connection. For example,

    # openssl s_client -connect google.com:443

     which should produce output like:

    depth=1 C = US, O = Google Inc, CN = Google Internet Authority
    verify error:num=20:unable to get local issuer certificate
    verify return:0
    Certificate chain
     0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
       i:/C=US/O=Google Inc/CN=Google Internet Authority
     1 s:/C=US/O=Google Inc/CN=Google Internet Authority
       i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
    Server certificate

    Once connected, it's possible to make simple requests by entering a GET command, such as:

    GET /index.html

    Enter Q to quit.

  • Comment By:
    03/11/2013 2:02PM
    Very cool. I did not know you could do that. Thanks for the post!
  • Comment By:
    03/11/2013 9:35PM
    It looked like it was time for a new post.

    Maybe I'll try to post something a little more often.
You must be logged into an account to post comments.