{"action":"created","issue":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/906","labels_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/906/labels{/name}","comments_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/906/comments","events_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/906/events","html_url":"https://github.com/restlet/restlet-framework-java/issues/906","id":31256500,"number":906,"title":"NIO SSL client/server sometimes fails to process data after a handshake","user":{"login":"jkeljo","id":6788825,"avatar_url":"https://avatars.githubusercontent.com/u/6788825?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeljo","html_url":"https://github.com/jkeljo","followers_url":"https://api.github.com/users/jkeljo/followers","following_url":"https://api.github.com/users/jkeljo/following{/other_user}","gists_url":"https://api.github.com/users/jkeljo/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeljo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeljo/subscriptions","organizations_url":"https://api.github.com/users/jkeljo/orgs","repos_url":"https://api.github.com/users/jkeljo/repos","events_url":"https://api.github.com/users/jkeljo/events{/privacy}","received_events_url":"https://api.github.com/users/jkeljo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Extension:%20NIO","name":"Extension: NIO","color":"fbca04"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Extension:%20SSL","name":"Extension: SSL","color":"fbca04"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Priority:%20medium","name":"Priority: medium","color":"f7c6c7"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/State:%20analysis","name":"State: analysis","color":"009800"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Type:%20bug","name":"Type: bug","color":"bfe5bf"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Version:%202.3","name":"Version: 2.3","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"thboileau","id":1122782,"avatar_url":"https://avatars.githubusercontent.com/u/1122782?v=3","gravatar_id":"","url":"https://api.github.com/users/thboileau","html_url":"https://github.com/thboileau","followers_url":"https://api.github.com/users/thboileau/followers","following_url":"https://api.github.com/users/thboileau/following{/other_user}","gists_url":"https://api.github.com/users/thboileau/gists{/gist_id}","starred_url":"https://api.github.com/users/thboileau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thboileau/subscriptions","organizations_url":"https://api.github.com/users/thboileau/orgs","repos_url":"https://api.github.com/users/thboileau/repos","events_url":"https://api.github.com/users/thboileau/events{/privacy}","received_events_url":"https://api.github.com/users/thboileau/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/milestones/7","html_url":"https://github.com/restlet/restlet-framework-java/milestones/Unplanned","labels_url":"https://api.github.com/repos/restlet/restlet-framework-java/milestones/7/labels","id":93010,"number":7,"title":"Unplanned","description":"","creator":{"login":"thboileau","id":1122782,"avatar_url":"https://avatars.githubusercontent.com/u/1122782?v=3","gravatar_id":"","url":"https://api.github.com/users/thboileau","html_url":"https://github.com/thboileau","followers_url":"https://api.github.com/users/thboileau/followers","following_url":"https://api.github.com/users/thboileau/following{/other_user}","gists_url":"https://api.github.com/users/thboileau/gists{/gist_id}","starred_url":"https://api.github.com/users/thboileau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thboileau/subscriptions","organizations_url":"https://api.github.com/users/thboileau/orgs","repos_url":"https://api.github.com/users/thboileau/repos","events_url":"https://api.github.com/users/thboileau/events{/privacy}","received_events_url":"https://api.github.com/users/thboileau/received_events","type":"User","site_admin":false},"open_issues":699,"closed_issues":42,"state":"open","created_at":"2012-03-07T14:54:41Z","updated_at":"2015-09-07T07:16:02Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2014-04-10T15:59:53Z","updated_at":"2015-10-21T16:07:36Z","closed_at":null,"body":"I've observed this connecting to the NIO SSL server on Android 4.0.4 from Chrome or Postman, however my investigation suggests that the problem is not unique to Android or to the server side.\r\n\r\nTypically I'm seeing the first request to a given server succeed, and subsequent requests time out. The difference between successful and failed requests appears to be how the handshake goes:\r\n- If the last handshake packet is sent by the server to the client, everything is fine\r\n- If the last handshake packet is sent by the client to the server, and the request is sent quickly, the server will never process the request\r\n\r\nThe root of the issue is in SslConnection.onFinished. It unconditionally sets the inbound way's ioState to INTEREST, overriding its previous state of READY and causing the Way's buffer processor to break out of the READY loop. If the request had already been read into the buffer, it will simply be left there, unprocessed. It should probably be changed to only set INTEREST if the state is currently IDLE.\r\n\r\nPresumably a parallel issue exists for a client's outbound way if the last handshake packet comes from the client, however I haven't reproduced that."},"comment":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/comments/149946578","html_url":"https://github.com/restlet/restlet-framework-java/issues/906#issuecomment-149946578","issue_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/906","id":149946578,"user":{"login":"amitchaturvedi","id":4932557,"avatar_url":"https://avatars.githubusercontent.com/u/4932557?v=3","gravatar_id":"","url":"https://api.github.com/users/amitchaturvedi","html_url":"https://github.com/amitchaturvedi","followers_url":"https://api.github.com/users/amitchaturvedi/followers","following_url":"https://api.github.com/users/amitchaturvedi/following{/other_user}","gists_url":"https://api.github.com/users/amitchaturvedi/gists{/gist_id}","starred_url":"https://api.github.com/users/amitchaturvedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitchaturvedi/subscriptions","organizations_url":"https://api.github.com/users/amitchaturvedi/orgs","repos_url":"https://api.github.com/users/amitchaturvedi/repos","events_url":"https://api.github.com/users/amitchaturvedi/events{/privacy}","received_events_url":"https://api.github.com/users/amitchaturvedi/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T16:07:36Z","updated_at":"2015-10-21T16:07:36Z","body":" @jlouvel thank you for your prompt reply. As I understood, the problem is with SSL Session Reuse.  Could you please suggest, if somehow we can disable the Session Reuse option by configuring some restlet parameters and can fix the issue.\r\n\r\nOr some other alternative. Actually we have an immediate release and changing the complete design based on some other framework will not be possible at this point of time.\r\n\r\nI am sure that you can suggest something which will definitely help me to avoid this situation.  The workaround which is provided by @jkeljo  may also help .  Could you please suggest me how to implement this ?\r\n\r\nLOOKING FORWARD TO YOUR SUPPORT AND GUIDANCE.\r\n\r\nRegards,\r\nAmit "}}