simple command line client

View: New views
8 Messages — Rating Filter:   Alert me  

simple command line client

by Lucito07 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I would like to know if any one knows of a simple command line client that can connect to a secure server using ssl, send a string of text, wait for a response and returns with that response. I know that with OpenSSL you can connect to the server using 'openssl s_client -connect remote.host:remote.port', but I would need to send the data and return with the response from a single command. Is that possible with OpenSSL directly, or is there a simple client that can do that?

Kindest regargs,

JLP

Re: simple command line client

by chickenandporn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stunnel.

It armours a basic connection into SSL, but you'd still need to run "expect" or "nc".

Allan


On Sat, Jul 5, 2008 at 23:04, Lucito07 <lucito07@...> wrote:

Hi,

I would like to know if any one knows of a simple command line client that
can connect to a secure server using ssl, send a string of text, wait for a
response and returns with that response. I know that with OpenSSL you can
connect to the server using 'openssl s_client -connect
remote.host:remote.port', but I would need to send the data and return with
the response from a single command. Is that possible with OpenSSL directly,
or is there a simple client that can do that?

Kindest regargs,

JLP
--
View this message in context: http://www.nabble.com/simple-command-line-client-tp18298414p18298414.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...



--
allanc@... "金鱼" http://linkedin.com/in/goldfish
please, no proprietary attachments (http://tinyurl.com/cbgq)

Re: simple command line client

by toorandom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I made a some I/O routines of SSL to make it 'easier'
check this, maybe it can be useful for you.

http://b3ck.blogspot.com/2008/05/magic-ssl-and-change-of-basis-matrix.html

Eduardo Ruiz Duarte

On Jul 6, 2008, at 8:15 PM, Allan Clark wrote:

> response and returns with that response. I know that with OpenSSL  
> you can

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...

simple command line client

by toorandom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

here is the example


Eduardo Ruiz Duarte

On Jul 6, 2008, at 8:15 PM, Allan Clark wrote:

Stunnel.

It armours a basic connection into SSL, but you'd still need to run "expect" or "nc".

Allan


On Sat, Jul 5, 2008 at 23:04, Lucito07 <lucito07@...> wrote:

Hi,

I would like to know if any one knows of a simple command line client that
can connect to a secure server using ssl, send a string of text, wait for a
response and returns with that response. I know that with OpenSSL you can
connect to the server using 'openssl s_client -connect
remote.host:remote.port', but I would need to send the data and return with
the response from a single command. Is that possible with OpenSSL directly,
or is there a simple client that can do that?

Kindest regargs,

JLP
--
View this message in context: http://www.nabble.com/simple-command-line-client-tp18298414p18298414.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...



--
allanc@... "金鱼" http://linkedin.com/in/goldfish
please, no proprietary attachments (http://tinyurl.com/cbgq)


Re: simple command line client

by Ger Hobbelt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Jul 6, 2008 at 5:04 AM, Lucito07 <lucito07@...> wrote:
[..]
> can connect to a secure server using ssl, send a string of text, wait for a
> response and returns with that response. I know that with OpenSSL you can
> connect to the server using 'openssl s_client -connect
> remote.host:remote.port', but I would need to send the data and return with
> the response from a single command. Is that possible with OpenSSL directly,
> or is there a simple client that can do that?


Hm, this should be possible straight out of the box, by feeding the
input to s_client through redirection so you'd get an EOF on stdin in
there once the line is fetched. What I mean is this: run

  echo "line to be sent to server" | s_client -host example/com -port 443

and the server's response should appear on stdout, while the OpenSSL
s_client app will terminate once that initial line is sent and the
server has sent a response and closed the connection.
(s_client can also be compiled as a separate binary)

Haven't tested this recently but I seem to recall that worked for me once.

Just make sure your command doesn't start with a capital 'Q'. ;-)


--
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web: http://www.hobbelt.com/
 http://www.hebbut.net/
mail: ger@...
mobile: +31-6-11 120 978
--------------------------------------------------
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...

Re: simple command line client

by Lucito07 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank a lot for the feedback. I will give it a shot.

Kindest regards,

JLP



Hm, this should be possible straight out of the box, by feeding the
input to s_client through redirection so you'd get an EOF on stdin in
there once the line is fetched. What I mean is this: run

  echo "line to be sent to server" | s_client -host example/com -port 443

and the server's response should appear on stdout, while the OpenSSL
s_client app will terminate once that initial line is sent and the
server has sent a response and closed the connection.
(s_client can also be compiled as a separate binary)

Haven't tested this recently but I seem to recall that worked for me once.

Just make sure your command doesn't start with a capital 'Q'. ;-)

Re: simple command line client

by Lucito07 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the feedback.

Kindest regards,

JLP


chickenandporn wrote:
Stunnel.

It armours a basic connection into SSL, but you'd still need to run "expect"
or "nc".

Allan


On Sat, Jul 5, 2008 at 23:04, Lucito07 <lucito07@yahoo.com> wrote:

>
> Hi,
>
> I would like to know if any one knows of a simple command line client that
> can connect to a secure server using ssl, send a string of text, wait for a
> response and returns with that response. I know that with OpenSSL you can
> connect to the server using 'openssl s_client -connect
> remote.host:remote.port', but I would need to send the data and return with
> the response from a single command. Is that possible with OpenSSL directly,
> or is there a simple client that can do that?
>
> Kindest regargs,
>
> JLP
> --
> View this message in context:
> http://www.nabble.com/simple-command-line-client-tp18298414p18298414.html
> Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       openssl-dev@openssl.org
> Automated List Manager                           majordomo@openssl.org
>



--
allanc@chickenandporn.com "金鱼" http://linkedin.com/in/goldfish
please, no proprietary attachments (http://tinyurl.com/cbgq)

Re: simple command line client

by Lucito07 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank a lot for the feedback. I will give it a shot. On what platform can it be compiled? Is the code portable as I might have to debug here at the office on Windows, and we might deploy later on a Linux platform?

Kindest regards,

JLP

toorandom wrote:
I made a some I/O routines of SSL to make it 'easier'
check this, maybe it can be useful for you.

http://b3ck.blogspot.com/2008/05/magic-ssl-and-change-of-basis-matrix.html

Eduardo Ruiz Duarte

On Jul 6, 2008, at 8:15 PM, Allan Clark wrote:

> response and returns with that response. I know that with OpenSSL  
> you can

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majordomo@openssl.org
LightInTheBox - Buy quality products at wholesale price