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

10,538

Solution 1

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.

Solution 2

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

Share:
10,538

Related videos on Youtube

Patlatus
Author by

Patlatus

Updated on September 18, 2022

Comments

  • Patlatus
    Patlatus over 1 year

    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

    while

    winpty openssl genrsa -des3 -out ca.key 4096
    

    is working fine?

  • Patlatus
    Patlatus over 6 years
    Could you please explain more? I didn't really get it
  • Mingye Wang
    Mingye Wang over 4 years
    adding to the answer: winpty runs an actual windows console window in the background
  • Mohammad Kholghi
    Mohammad Kholghi about 2 years
    @Patlatus native OpenSSL can't be run in a not-native shell.
  • Admin
    Admin almost 2 years
    Thanks all! It might improve the answer to give some detailed description of a "native shell".