Thread (4 messages) 4 messages, 3 authors, 2024-08-13

Re: Bug with bash and OpenSSL usage on Windows

From: Johannes Schindelin <hidden>
Date: 2024-08-13 13:06:40

Hi Tim,

I suspect that you also reported this issue at
https://github.com/git-for-windows/git/issues/5079. For the benefit of
readers of this list, here is the explanation:

`openssl.exe` is a pure Win32 program, while Git Bash uses a friendly fork
of the Cygwin POSIX emulation layer. The latter, therefore, uses emulated
pseudo terminals, but Win32 programs only use Win32 Consoles.

For the moment, therefore, programs like `openssl.exe` that want to
interact with the user via such a Win32 Console have to be called via the
`winpty` helper that acts as a translator between Win32 Consoles and
emulated Unix pseudo terminals.

Modern Windows versions support a concept called "pseudo consoles" that
are similar to Unix pseudo terminals, similar enough that there is an
option to use them, which would avoid the need for that `winpty` helper.

In the near future, the Git for Windows project will switch the default to
use those pseudo consoles by default (where available, that is).

Ciao,
Johannes

On Sat, 27 Jul 2024, Tim Abdiukov wrote:
  What did you do before the bug happened? (Steps to reproduce your issue)
Tried to generate a self-signed certificate using git bash.

Using git bash, I ran
openssl genrsa -aes256 (private key location) 4096
however, openssl just hung (on Windows). Cmd can execute this command,
but bash cannot.

What did you expect to happen? (Expected behavior)

openssl to generate messages about key generation to stdout

What happened instead? (Actual behavior)

openssl just hung

What's different between what you expected and what actually happened?

openssl just hung, rendering it unusable within bash Windows

Anything else you want to add:

This is an issue specifically with Windows x64.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.45.2.windows.1
cpu: x86_64
built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 14.1
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]
not run from a git repository - no hooks to show
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help