How can I force quit inside “openssl s_client -connect”?

怎甘沉沦 提交于 2019-12-11 01:55:03

问题


I am writing a script that calls the command.

openssl s_client -showcerts -connect server:9999 > out.pem -key key.pem -cert cert.pem -pass pass:password

But it displays an output, I tried adding -quiet but with no luck. Is there a way I can get it so that it won't report to the console. If I run the command in terminal I have to type exit to get out of the connection.

Edit

I want this to exit automatically with in my script. Is there a way to do that?


回答1:


The output is possibly being sent to stderr (rather than stdout). It should work if you use >& for the redirection.




回答2:


For the automatically exit part, you could do this:

echo | openssl s_client -connect www.google.com:443


来源:https://stackoverflow.com/questions/5160932/how-can-i-force-quit-inside-openssl-s-client-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!