Skip to content

Use native TLS when certificate validation is disabled#425

Open
gschier wants to merge 1 commit intomainfrom
fix/native-tls-legacy-servers
Open

Use native TLS when certificate validation is disabled#425
gschier wants to merge 1 commit intomainfrom
fix/native-tls-legacy-servers

Conversation

@gschier
Copy link
Copy Markdown
Member

@gschier gschier commented Mar 12, 2026

Summary

  • When "Validate TLS certificates" is disabled, use the OS native TLS stack (Secure Transport/SChannel/OpenSSL) instead of rustls
  • Fixes TLS handshake failures against legacy servers (e.g. IBM WebSphere) that only support TLS 1.0, since rustls only implements TLS 1.2+
  • No change to default behavior — rustls is still used when validation is enabled

Ref: https://yaak.app/feedback/posts/tls-handshake-eof-when-connecting-to-private-ibm-websphere-endpoint-works-when-s

Test plan

  • Verify normal HTTPS requests still work with "Validate TLS certificates" enabled (rustls path)
  • Verify requests work with "Validate TLS certificates" disabled against a standard HTTPS server (native-tls path)
  • Verify requests work against a TLS 1.0-only server with validation disabled

🤖 Generated with Claude Code

…ver compatibility

When "Validate TLS certificates" is disabled, use the OS native TLS stack
(Secure Transport/SChannel/OpenSSL) instead of rustls. This adds support for
TLS 1.0+ connections to legacy servers like IBM WebSphere, which rustls cannot
handle since it only implements TLS 1.2+.

Ref: https://yaak.app/feedback/posts/tls-handshake-eof-when-connecting-to-private-ibm-websphere-endpoint-works-when-s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67cbb06bb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if !crt_path.is_empty() && !key_path.is_empty() {
let crt_data = std::fs::read(crt_path)?;
let key_data = std::fs::read(key_path)?;
let identity = native_tls::Identity::from_pkcs8(&crt_data, &key_data)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep PKCS#1 client keys working in native TLS path

The new validate_certificates == false flow loads CRT+KEY identities with native_tls::Identity::from_pkcs8, which only accepts PKCS#8 keys and rejects common BEGIN RSA PRIVATE KEY (PKCS#1) files; before this change, the same path went through yaak_tls::load_private_key and accepted PKCS#1/PKCS#8/EC keys. This introduces a regression where mTLS requests now fail for users who disable certificate validation and provide an RSA PEM key that previously worked.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant