{"action":"opened","issue":{"url":"https://api.github.com/repos/akka/akka/issues/19617","labels_url":"https://api.github.com/repos/akka/akka/issues/19617/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/19617/comments","events_url":"https://api.github.com/repos/akka/akka/issues/19617/events","html_url":"https://github.com/akka/akka/issues/19617","id":128817268,"number":19617,"title":"akka-http occasionally throws akka.stream.scaladsl.One2OneBidiFlow$OutputTruncationException$: null when using https  ","user":{"login":"FrankvanMeeuwen","id":12701168,"avatar_url":"https://avatars.githubusercontent.com/u/12701168?v=3","gravatar_id":"","url":"https://api.github.com/users/FrankvanMeeuwen","html_url":"https://github.com/FrankvanMeeuwen","followers_url":"https://api.github.com/users/FrankvanMeeuwen/followers","following_url":"https://api.github.com/users/FrankvanMeeuwen/following{/other_user}","gists_url":"https://api.github.com/users/FrankvanMeeuwen/gists{/gist_id}","starred_url":"https://api.github.com/users/FrankvanMeeuwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrankvanMeeuwen/subscriptions","organizations_url":"https://api.github.com/users/FrankvanMeeuwen/orgs","repos_url":"https://api.github.com/users/FrankvanMeeuwen/repos","events_url":"https://api.github.com/users/FrankvanMeeuwen/events{/privacy}","received_events_url":"https://api.github.com/users/FrankvanMeeuwen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-26T13:16:52Z","updated_at":"2016-01-26T13:16:52Z","closed_at":null,"body":"We have build a client using akka-http which sends a single request to a rest api on demand. This is working fine when using http with the cachedHostConnectionPool. However when using https, with the cachedHostConnectionPoolTls, occasionally we receive the `akka.stream.scaladsl.One2OneBidiFlow$OutputTruncationException$: null` exception. I found that preceding the error, the server initiates to close the connection by sending a [FIN,ACK]. (It does not send a close_notify first, which is not according to the specifications but seems to be used by more servers.) \r\n\r\nWhen turning on debug logging i can see that javax.net.sll throws an exception when the closeInbound() is called, which might be related to the problem. \r\n\r\n```\r\nplugin-framework-akka.actor.default-dispatcher-248, called closeInbound()\r\nplugin-framework-akka.actor.default-dispatcher-248, fatal error: 80: Inbound closed before receiving peer's close_notify: possible truncation attack?\r\njavax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?\r\n%% Invalidated: [Session-3, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256]\r\nplugin-framework-akka.actor.default-dispatcher-248, SEND TLSv1.2 ALERT: fatal, description = internal_error\r\n```\r\n\r\nThe problem is that quite some request fail with this `akka.stream.scaladsl.One2OneBidiFlow$OutputTruncationException$: null exception`, as if they still use the connection which the server wants to close. With wireshark i could see that no request are even send to the server when this exception occurs. \r\n\r\nAs a workaround, i found out that, because the server closes connections after 5 seconds of inactivity, if i use the configuration setting: {akka.http.idle-timeout = 4 seconds} the problem disappears."}}