Skip to content

Commit

Permalink
Fix regression caused by transport.TLS not being set to True on the t…
Browse files Browse the repository at this point in the history
…lsmemorybios transport (#77)
  • Loading branch information
michael-lazar authored Oct 16, 2023
1 parent 8282cac commit cfeb17e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
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

0 comments on commit cfeb17e

Please sign in to comment.