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

[Bug] mTLS doesn't support non-EC private keys #371

Closed
dgjustice opened this issue Aug 21, 2023 · 2 comments · Fixed by #380
Closed

[Bug] mTLS doesn't support non-EC private keys #371

dgjustice opened this issue Aug 21, 2023 · 2 comments · Fixed by #380
Labels
bug Something isn't working

Comments

@dgjustice
Copy link

What are you really trying to do?

Using a PEM file beginning with -----BEGIN EC PRIVATE KEY-----:

Traceback

RuntimeError: Failed client connect: Server connection error: tonic::transport::Error(Transport, PrivateKeyParseError)

Temporary remedy

Convert your pkey to pkcs8:

openssl pkcs8 -topk8 -nocrypt -in key.pem -out key-pkcs8.pem

Describe the bug

python-sdk is pointing to an older commit in sdk-core which depends on an older version of tonic.
The key issue has been fixed in this tonic PR.

Minimal Reproduction

def setup_tls_config() -> TLSConfig:
    """Helper func to build TLSConfig struct."""
    with open(os.getenv("TEMPORAL_CLI_TLS_CERT"), "rb") as f:
        client_cert = f.read()
    with open(os.getenv("TEMPORAL_CLI_TLS_KEY"), "rb") as f:
        client_private_key = f.read()
    with open(os.getenv("TEMPORAL_CLI_TLS_CA"), "rb") as f:
        server_root_ca_cert = f.read()
    return TLSConfig(
        client_cert=client_cert,
        client_private_key=client_private_key,
        domain=os.getenv("TEMPORAL_CLI_TLS_SERVER_NAME"),
        server_root_ca_cert=server_root_ca_cert,
    )

Environment/Versions

  • OS and processor: Linux i7
  • Temporal Version: temporalio==1.3.0
  • Are you using Docker or Kubernetes or building Temporal from source? Kubernetes

Additional context

If updating to a more recent core SDK version is fairly straightforward, feel free to throw me some pointers, and I will put together a PR.

@dgjustice dgjustice added the bug Something isn't working label Aug 21, 2023
@cretz
Copy link
Member

cretz commented Aug 22, 2023

👍 We just overcame a hurdle to going past 0.8 Tonic (OTel libs), so we will be upgrading Tonic and all of these libraries before next release.

@dgjustice
Copy link
Author

Awesome, good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants