{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/24198","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/24198/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/24198/comments","events_url":"https://api.github.com/repos/golang/go/issues/24198/events","html_url":"https://github.com/golang/go/issues/24198","id":301370954,"node_id":"MDU6SXNzdWUzMDEzNzA5NTQ=","number":24198,"title":"crypto/tls: handshake hangs when running over synchronous/unbuffered connection","user":{"login":"runeaune","id":7382090,"node_id":"MDQ6VXNlcjczODIwOTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7382090?v=4","gravatar_id":"","url":"https://api.github.com/users/runeaune","html_url":"https://github.com/runeaune","followers_url":"https://api.github.com/users/runeaune/followers","following_url":"https://api.github.com/users/runeaune/following{/other_user}","gists_url":"https://api.github.com/users/runeaune/gists{/gist_id}","starred_url":"https://api.github.com/users/runeaune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runeaune/subscriptions","organizations_url":"https://api.github.com/users/runeaune/orgs","repos_url":"https://api.github.com/users/runeaune/repos","events_url":"https://api.github.com/users/runeaune/events{/privacy}","received_events_url":"https://api.github.com/users/runeaune/received_events","type":"User","site_admin":false},"labels":[{"id":357033853,"node_id":"MDU6TGFiZWwzNTcwMzM4NTM=","url":"https://api.github.com/repos/golang/go/labels/WaitingForInfo","name":"WaitingForInfo","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-01T11:29:58Z","updated_at":"2018-10-17T04:08:30Z","closed_at":"2018-03-28T14:49:08Z","author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n\r\n### What version of Go are you using (`go version`)?\r\n`go1.9.4`\r\n\r\n### Does this issue reproduce with the latest release?\r\nMost likely\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n`darwin` and `amd64`\r\n\r\n### What did you do?\r\n\r\nI'm writing a test that relies on `crypto/tls` but mocks out the underlying `net.Conn` with https://github.com/jordwest/mock-conn/blob/master/end.go (this implements an *unbuffered*, local `net.Conn` based on two `io.Pipe`s).\r\n\r\n(I can help provide full example code if I get confirmation that fixing this issue is likely to be prioritized)\r\n\r\n### What did you expect to see?\r\n\r\nI expected a completed handshake, and a useable TLS tunnel to be set up over the pipe. As far as I can tell, this can be achieved by never flushing multiple records together, or by reading responses in parallel with the flushing.\r\n\r\n### What did you see instead?\r\n\r\nThe TLS handshake hangs and eventually times out.\r\n\r\nMy limited digging points towards this `flush` as a likely culprit: https://github.com/golang/go/blob/4c1aff87f1a160c3da962cda0c48462c88260d7b/src/crypto/tls/handshake_server.go#L444\r\n\r\nThere seems to be multiple records being flushed together. The receiver wants to respond to the first one, but the sender needs to complete the flush before accepting any responses. Thus they are both blocked trying to write to the connection."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/430482789","html_url":"https://github.com/golang/go/issues/24198#issuecomment-430482789","issue_url":"https://api.github.com/repos/golang/go/issues/24198","id":430482789,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDQ4Mjc4OQ==","user":{"login":"gopherbot","id":8566911,"node_id":"MDQ6VXNlcjg1NjY5MTE=","avatar_url":"https://avatars1.githubusercontent.com/u/8566911?v=4","gravatar_id":"","url":"https://api.github.com/users/gopherbot","html_url":"https://github.com/gopherbot","followers_url":"https://api.github.com/users/gopherbot/followers","following_url":"https://api.github.com/users/gopherbot/following{/other_user}","gists_url":"https://api.github.com/users/gopherbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gopherbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopherbot/subscriptions","organizations_url":"https://api.github.com/users/gopherbot/orgs","repos_url":"https://api.github.com/users/gopherbot/repos","events_url":"https://api.github.com/users/gopherbot/events{/privacy}","received_events_url":"https://api.github.com/users/gopherbot/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T04:08:30Z","updated_at":"2018-10-17T04:08:30Z","author_association":"NONE","body":"Change https://golang.org/cl/142817 mentions this issue: `crypto/tls: replace net.Pipe in tests with real TCP connections`"}}
{"actor":{"display_login":"gopherbot"}}