Conversation
This was referenced Aug 30, 2026
yohimik
force-pushed
the
upstream-pr/hosted-crypto-tls
branch
from
September 2, 2026 08:50
2d41706 to
4b2c48c
Compare
Author
|
Rebased on dev after the 0.42.0 release. The change applies on top of v0.42.0 |
TinyGo replaces crypto/tls with a stub whose handshake does nothing, so a program that dials https gets a plaintext connection behind the TLS API. That stub is correct for a target with no OS below it, which has neither the code size for a full TLS implementation nor usually a socket to speak it over. Hosted linux and macOS have both, and there the crypto/tls of the Go standard library compiles and runs. Make the override conditional. Without an entry in the map, crypto/tls falls under the "crypto/" merge, which links the package of the standard library into the synthetic GOROOT. GOOS alone cannot decide this, because a baremetal target reports GOOS=linux, so the build tags decide as well. The goroot cache key is a hash of the merge links, so the two variants get separate cache entries. testdata/hostcryptotls.go does a TLS handshake over an in-memory pipe with a certificate that it makes at run time. On the current dev branch it prints "negotiated an unexpected version: 0", because the stub does no handshake. With this change the handshake completes, the data goes through, and a client that does not trust the certificate refuses it. loader/goroot_test.go covers the targets that keep the stub, the baremetal one that reports GOOS=linux included.
yohimik
force-pushed
the
upstream-pr/hosted-crypto-tls
branch
from
September 5, 2026 02:28
4b2c48c to
c5f0e2b
Compare
yohimik
marked this pull request as draft
September 5, 2026 02:30
This was referenced Sep 5, 2026
Member
|
See my other feedback on recent PRs @yohimik and resubmit after creating a specific issue first. Make sure to follow AGENTS.md Thank you! |
This was referenced Sep 17, 2026
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #5700. The problem is tracked in #5696.
Closed on 17 September 2026 with a request for an issue first. The replacement uses the same patch, rebased on 18 September onto
devat93940cb6. Its description contains the scope, dependencies, and test status.