Doing HTTPS requests from the command line with (basic) password authentication

Imagine you want to test a web service/site secured by SSL and a password. Here is how to do that from the commandline:

In this example these values are used:

  • username: username
  • password: password
  • hostname: example.com

Generate the base64 encoded username and password combination:

echo -n "username:password"  | openssl base64 -base64

The output will be something like dXNlcm5hbWU6cGFzc3dvcmQ=. Paste that string into a file called "input.txt".

GET /some/directory/some-file.html HTTP/1.1
Host: example.com
Authentication: basic dXNlcm5hbWU6cGFzc3dvcmQ=

N.B. The two empty lines are required.

Next, throw that file into openssl:

(cat input.txt ; sleep 3) | openssl s_client -connect example.com:443

The output will show all headers and HTML content so you can grep all you want.

Comments

I am a well-qualified writer

I am a well-qualified writer and I have written an article on SSL certificates where I describe that A protected authentication is a record used to affirm that an individual or association is who they say they are. An authentication opens to the general population the genuine organization name and full web space name that the testament is enrolled to and conveys with it both creation and close dates. A protected testament transmits information on the Secure Socket Layer (SSL) which encodes the information utilizing long decoding strings and other encryption innovation.

A few administrations are set

A few administrations are set up to require HTTP validation and after that you have to give a name and secret word which then is exchanged to the remote site in different routes relying upon the correct verification convention utilized. professional assignment writers. You can pick to either embed the client and secret key in the URL or you can give them independently..

Nice idea. Have tried this

Nice idea. Have tried this process, and it worked well. - Marla Ahlgrimm

that is an remarkable post I

that is an remarkable post I visible. I have to thanks to you to proportion it. it's far definitely what I desired to peer desire in future you will hold for sharing such an incredible publish. I’m very fired up to show it to anyone. It makes me so happy your enormous data and understanding have a brand new channel for trying into the area. i am hoping you'll maintain this net website updated so clients can come and examine thrilling stories.

Yes indeed it is a remarkable

Yes indeed it is a remarkable post. We agree with it. Thank you very much for this good words you have said about it.