Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression caused by transport.TLS not being set to True on the t… #77

Merged
merged 1 commit into from
Oct 16, 2023
Merged
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

### Unreleased

### v0.10.1 (2023-10-16)

#### Fixes

- Fixed regression that prevented TLS client certificates and other
TLS environment variables from being initialized.

### v0.10.0 (2023-10-15)

#### Features
Expand Down
2 changes: 1 addition & 1 deletion jetforce/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.0"
__version__ = "0.10.1"
8 changes: 6 additions & 2 deletions jetforce/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ def build_environ(self) -> EnvironDict:
"SERVER_PROTOCOL": "GEMINI",
"SERVER_SOFTWARE": f"jetforce/{__version__}",
}
if not self.transport.TLS:

try:
cert = self.transport.getPeerCertificate()
except AttributeError:
# We're not using a TLS-enabled transport, we can skip
# all of the TLS environment initialization below.
return environ

conn = self.transport.getHandle()
Expand All @@ -230,7 +235,6 @@ def build_environ(self) -> EnvironDict:
}
)

cert = self.transport.getPeerCertificate()
if cert:
x509_cert = cert.to_cryptography()
cert_data = inspect_certificate(x509_cert)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def long_description() -> str:

setuptools.setup(
name="Jetforce",
version="0.10.0",
version="0.10.1",
url="https://github.com/michael-lazar/jetforce",
license="Other/Proprietary License",
author="Michael Lazar",
Expand Down