{"action":"opened","issue":{"url":"https://api.github.com/repos/snoyberg/http-client/issues/165","labels_url":"https://api.github.com/repos/snoyberg/http-client/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/snoyberg/http-client/issues/165/comments","events_url":"https://api.github.com/repos/snoyberg/http-client/issues/165/events","html_url":"https://github.com/snoyberg/http-client/issues/165","id":114485044,"number":165,"title":"TlsExceptionHostPort (HandshakeFailed (Error_Packet_unexpected \"Alert [(AlertLevel_Fatal,BadRecordMac)]\" \" expected: change cipher\"))","user":{"login":"glasserc","id":17006,"avatar_url":"https://avatars.githubusercontent.com/u/17006?v=3","gravatar_id":"","url":"https://api.github.com/users/glasserc","html_url":"https://github.com/glasserc","followers_url":"https://api.github.com/users/glasserc/followers","following_url":"https://api.github.com/users/glasserc/following{/other_user}","gists_url":"https://api.github.com/users/glasserc/gists{/gist_id}","starred_url":"https://api.github.com/users/glasserc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glasserc/subscriptions","organizations_url":"https://api.github.com/users/glasserc/orgs","repos_url":"https://api.github.com/users/glasserc/repos","events_url":"https://api.github.com/users/glasserc/events{/privacy}","received_events_url":"https://api.github.com/users/glasserc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-01T18:40:52Z","updated_at":"2015-11-01T18:40:52Z","closed_at":null,"body":"[This gist](https://gist.github.com/glasserc/3f867fb9538d64fcd63d) reproduces a failure I saw using the [twitter-conduit](https://hackage.haskell.org/package/twitter-conduit) library with the [parallel-io](https://hackage.haskell.org/package/parallel-io) library. Depending on the value chosen for `numThreads`, I either get success, or a variety of interesting error messages, such as (with n=250):\r\n\r\n```\r\nmany-tls: TlsExceptionHostPort (HandshakeFailed (Error_Packet_unexpected \"Alert [(AlertLevel_Fatal,BadRecordMac)]\" \" expected: change cipher\")) \"www.google.com\" 443\r\n```\r\n\r\nWith n=1000:\r\n\r\n```\r\nmany-tls: FailedConnectionException2 \"www.google.com\" 443 True <socket: 432>: hPutBuf: resource vanished (Broken pipe)\r\nmany-tls: TlsExceptionHostPort (HandshakeFailed Error_EOF) \"www.google.com\" 443\r\n```\r\n\r\nI'm concerned that I'm hitting some kind of race condition where the TLS negotiation on multiple connections to the same server is happening in two different threads. Have you ever seen this? Is there a better way to do what I'm trying to do? I've tried replacing the `withResponse` call to an `httpLbs` call and the errors persist, although maybe in different proportions."}}