Question

I have the following command.

openssl s_client -connect my.site.com:443

This connects, so then I type the following:

GET /ws/map/v1/search.wsdl HTTP/1.1
Host: my.site.com

This returns the xml I'm looking for from the wsdl.

However, I'm finding it hard to script it to run as one job.

#!/bin/bash
echo 'openssl s_client -connect my.site.com:443'
echo 'GET /ws/map/v1/search.wsdl HTTP/1.1
Host: my.site.com'
while read x
do
  echo "$x"
done

Is there something i'm missing here when trying to send this command to the ssl console, and have it read to a var that I can work with??

Thanks much! Ben

okay, so now I have script 1 which has the following.

#!/bin/bash
openssl s_client -connect my.site.com:443

and script 2 does

#!/bin/bash
echo 'GET /ws/map/v1/search.wsdl HTTP/1.1'
echo 'Host: my.site.com'
while read x
do
  echo "$x"
done

and when I type script1.sh | script2.sh

and I get : bad interpreter: A file or directory in the path name does not exist.

any ideas?

Was it helpful?

Solution

Got it! :)

echo -e "GET /ws/map/v1/search.wsdl HTTP/1.1\nHost: my.site.com\n\n" | openssl s_client -connect my.site.com:443 -ign_eof

Really hope this helps someone going forward.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top