Why do i need prefix openssl with winpty on windows bash?

Why does command

openssl genrsa -des3 -out ca.key 4096

hangs and doesn't respond


winpty openssl genrsa -des3 -out ca.key 4096

is working fine?

2 Answers 2


bash from Git for Windows uses mintty. mintty cannot present itself as console to openssl but winpty can because it does the required conversions. Learn the details at Git for Windows FAQ.

  • adding to the answer: winpty runs an actual windows console window in the background Aug 14, 2019 at 3:21

winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. The package consists of a library (libwinpty) and a tool for Cygwin and MSYS for running Windows console programs in a Cygwin/MSYS pty

Because you try to run native openssl in not-native shell, you have to have interface of winpty

  • Could you please explain more? I didn't really get it
    – Patlatus
    Dec 1, 2017 at 14:57
  • @Patlatus native OpenSSL can't be run in a not-native shell. Mar 7, 2022 at 11:43
  • Thanks all! It might improve the answer to give some detailed description of a "native shell".
    – blong
    Jul 1, 2022 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.