openssl hangs and does not exit
It looks like some OpenSSL distributions for Windows are expecting an additional keypress, independant of standard input. Quit.txt gets correctly piped into openssl's STDIN (the server receives QUIT command), but nothing happens until you press any key.
This problem does not exist in Cygwin's version of OpenSSL. Unfortunatly base installation of Cygwin takes about 100 MB of disk space, but you can try to extract only openssl.exe and required libraries.
This method works:
echo QUIT | c:\cygwin\bin\openssl.exe s_client -showcerts -connect google.com:443 > cert.txt
OpenSSL hangs during PKCS12 export with Loading 'screen' into random state
Please try to add winpty
before oppenssl:
winpty openssl ...
or you can run a new bash wrapped by winpty:
winpty bash
In the windows console, there is some problem with terminal input/output so winpty can help if some software requires unix
terminal behavior.
winpty
helped me to run openssl in this environment:
git version 2.7.3.windows.1
OpenSSL 1.0.2g 1 Mar 2016
openssl command hangs
You need another argument, it expects to read a certificate from standard input. Probably you meant to add -new
as a command line argument, or you need to pass an existing certificate on standard in.
Creating CSR with OpenSSL hangs
It should have -new
:
ECHO Creating certificate sign request (CSR) -------------
openssl req -new -key %1.key -out %1.csr
Openssl output hanging when getting -enddate
It's easier to start small and build up rather than to start big and debug down.
Here's an easier way to reproduce your problem, which also just hangs:
openssl s_client -connect google.com:443
Now that the problem is so simple and narrow, googling "why would openssl s_client hang?" leads to useful information recommending echo -n | ...
to "give a response to the server, so that the connection is released". That should be sufficient to get further (there are other problems).
Anyways, here's a shorter way to do this:
if openssl s_client -connect google.com:443 2> /dev/null < /dev/null |
openssl x509 -checkend $((60*60*24*7)) -noout -in /dev/stdin
then
echo "The certificate is good."
else
echo "The certificate expires within a week."
fi
OpenSSL hanging when trying to encrypt
You're missing an -in
in the first half of the command, which is subsequently trying to read data from standard input (and thus hanging).
The correct command line should be
openssl smime -sign -signer C:\Users\MyName\Desktop\OpenSSLTest\my-pubcert.pem -inkey
C:\Users\MyName\Desktop\OpenSSLTest\my-prvkey.pem -outform der -nodetach -binary
-in C:\Users\MyName\Desktop\OpenSSLTest\DataToEncrypt.txt | openssl smime -encrypt -des3
-binary -outform pem C:\Users\MyName\Desktop\OpenSSLTest\paypal_cert.pem
Notice the addition of -in
to line 3.
Then DataToEncrypt.txt will be correctly read as an input file.
Related Topics
Different CPU Cache Size Reported by /Sys/Device/ and Dmidecode
Externally Disabling Signals for a Linux Program
What's The Meaning of 'Blacklisted' on Gstreamer
Only Accept Http Connections from Localhost in Go
How to Check If Jboss Is Running on Unix Server
Trying to Launch an External Editor from Within a Go Program
How to Give File Permission to a Specific User in a Group
Rpm Installation Fails Due to Depencency /Bin/Sh Not Found
File Format Differences Between a Static Library (.A) and a Shared Library (.So)
Unknown Symbol in While Loading a Kernel Module
Why Does Git Fail on Push/Fetch with "Too Many Open Files"
Why Is The Close Function Is Called Release in 'struct File_Operations' in The Linux Kernel
How to Simulate Two Consecutive Enter Key Presses for a Command in a Bash Script
How to Copy The Top 10 Most Recent Files from One Directory to Another
Splitting Bulk Text File Every N Line
Executing Exe or Bat File on Remote Windows Machine from *Nix