Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux command line for ssl server?

I always use the socket command line tool to do quick socket tests for programs I'm writing. http://w21.org/jnickelsen/socket/

I was wondering if there was a similar command line tool to set up a quick ssl socket client/server to test things.

Edit: Easy Answer

So to make it easy on people who may wonder the same thing:

If you want to be a client use openssl's s_client:

openssl s_client -connect host:port

If you want to be a server use openssl's s_server:

openssl s_server -accept <port> -key <keyfile> -cert <certfile>

Quick And Dirty cert and key for the server to use for testing:

openssl req -x509 -nodes -days 365 -newkey rsa -keyout keyfile.key -out certfile.crt
like image 571
MechaMarinara Avatar asked Jan 02 '14 18:01

MechaMarinara


1 Answers

Quick SSL Client:

openssl s_client -connect <host>:<port>

Quick SSL Server:

openssl s_server -accept <port> 
like image 177
Remi Gacogne Avatar answered Oct 11 '22 17:10

Remi Gacogne