Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/specify_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def version(
):
"""Display version and system information."""
import platform
import ssl

cli_version = get_speckit_version()

Expand Down Expand Up @@ -489,6 +490,12 @@ def version(
info_table.add_row("Platform", platform.system())
info_table.add_row("Architecture", platform.machine())
info_table.add_row("OS Version", platform.version())
# The OpenSSL runtime the interpreter actually loaded. HTTPS failure
# reports (#4433) hinge on which OpenSSL is in play, and on Windows it is
# not obvious from the outside, so surface it here.
openssl_version = getattr(ssl, "OPENSSL_VERSION", "")
if openssl_version:
info_table.add_row("OpenSSL", openssl_version)

panel = Panel(
info_table,
Expand Down
18 changes: 18 additions & 0 deletions tests/test_cli_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for CLI version reporting."""

import json
import ssl
from unittest.mock import patch

from typer.testing import CliRunner
Expand Down Expand Up @@ -77,3 +78,20 @@ def test_version_json_requires_features(self):

assert result.exit_code != 0
assert "--json requires --features" in result.output

def test_version_reports_openssl_runtime(self):
"""specify version reports the OpenSSL runtime the interpreter loaded.

Regression test for the triage gap in #4433: HTTPS failures on Windows
are commonly blamed on a PATH-preceded OpenSSL DLL, but ``specify
version`` reported no OpenSSL information at all, so a report had no way
to show which runtime was actually in use.
"""
with patch("specify_cli.get_speckit_version", return_value="1.2.3"):
result = runner.invoke(app, ["version"])

assert result.exit_code == 0

expected = ssl.OPENSSL_VERSION
assert expected, "test host reports no ssl.OPENSSL_VERSION to assert against"
assert expected in result.output