{"action":"created","issue":{"url":"https://api.github.com/repos/Lukasa/hyper/issues/213","repository_url":"https://api.github.com/repos/Lukasa/hyper","labels_url":"https://api.github.com/repos/Lukasa/hyper/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/Lukasa/hyper/issues/213/comments","events_url":"https://api.github.com/repos/Lukasa/hyper/issues/213/events","html_url":"https://github.com/Lukasa/hyper/issues/213","id":143013684,"number":213,"title":"inform about ALPN/NPN support on local/remote","user":{"login":"mylh","id":3874268,"avatar_url":"https://avatars3.githubusercontent.com/u/3874268?v=3","gravatar_id":"","url":"https://api.github.com/users/mylh","html_url":"https://github.com/mylh","followers_url":"https://api.github.com/users/mylh/followers","following_url":"https://api.github.com/users/mylh/following{/other_user}","gists_url":"https://api.github.com/users/mylh/gists{/gist_id}","starred_url":"https://api.github.com/users/mylh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mylh/subscriptions","organizations_url":"https://api.github.com/users/mylh/orgs","repos_url":"https://api.github.com/users/mylh/repos","events_url":"https://api.github.com/users/mylh/events{/privacy}","received_events_url":"https://api.github.com/users/mylh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-03-23T16:39:55Z","updated_at":"2017-06-02T09:13:19Z","closed_at":null,"body":"Hello,\n\nI encountered the following issue when connect to Apple push notification service with hyper. Current APNS endpoint uses HTTP/2. Connects from python 2.7.10 works good, but when I try to connect from python 3.4 I just get ConnectionReset error every time. After spending some hours for investigation I ended up with the following. APNS does not support NPN (which is considered obsolete as I understand) and only support ALPN. And ALPN support in python ssl module is only started from python 3.5.  In hyper.tls we have the following code \n\n```\n    # ALPN is newer, so we prefer it over NPN. The odds of us getting different\n    # answers is pretty low, but let's be sure.\n    with ignore_missing():\n        proto = ssl_sock.selected_alpn_protocol()\n\n    with ignore_missing():\n        if proto is None:\n            proto = ssl_sock.selected_npn_protocol()\n```\n\nWhat we see here is that absense of ALPN support is silently ignored. And since NPN is not supported at endpoint hyper follows http1.1 connection scheme though current endpoint is HTTP2.\n\nI think that it is better to allow developers using hyper to specify wether they want to ignore_missing or not and raise exceptions when this happens. At least they will not spent a day figuring out why it works in one python version and not in other. And most of the times you know when HTTP/2 is supported on your endpoint but even if you use HTTP20Connection you still get assertion error because NPN is not supported at remote end and ALPN at your end and this goes silently.\n\nWhat do you think?\n\n(looks like for my case I will need to use local copy of the hyper with hardcoded 'h2' proto by default, and I'm not happy about it)\n"},"comment":{"url":"https://api.github.com/repos/Lukasa/hyper/issues/comments/305734126","html_url":"https://github.com/Lukasa/hyper/issues/213#issuecomment-305734126","issue_url":"https://api.github.com/repos/Lukasa/hyper/issues/213","id":305734126,"user":{"login":"Lec2cn","id":3175144,"avatar_url":"https://avatars0.githubusercontent.com/u/3175144?v=3","gravatar_id":"","url":"https://api.github.com/users/Lec2cn","html_url":"https://github.com/Lec2cn","followers_url":"https://api.github.com/users/Lec2cn/followers","following_url":"https://api.github.com/users/Lec2cn/following{/other_user}","gists_url":"https://api.github.com/users/Lec2cn/gists{/gist_id}","starred_url":"https://api.github.com/users/Lec2cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lec2cn/subscriptions","organizations_url":"https://api.github.com/users/Lec2cn/orgs","repos_url":"https://api.github.com/users/Lec2cn/repos","events_url":"https://api.github.com/users/Lec2cn/events{/privacy}","received_events_url":"https://api.github.com/users/Lec2cn/received_events","type":"User","site_admin":false},"created_at":"2017-06-02T09:13:19Z","updated_at":"2017-06-02T09:13:19Z","body":"@Lukasa  Solving the problem by upgrade ubuntu to the new version and the openssl automatically update to 1.0.2.\r\nThanks for helping! "}}
{"actor":{"display_login":"Lec2cn"}}