{"action":"opened","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/3049","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/3049/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/3049/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/3049/events","html_url":"https://github.com/square/okhttp/issues/3049","id":196887202,"number":3049,"title":"Extensions 'sni' setting error.","user":{"login":"sandking","id":3198883,"avatar_url":"https://avatars.githubusercontent.com/u/3198883?v=3","gravatar_id":"","url":"https://api.github.com/users/sandking","html_url":"https://github.com/sandking","followers_url":"https://api.github.com/users/sandking/followers","following_url":"https://api.github.com/users/sandking/following{/other_user}","gists_url":"https://api.github.com/users/sandking/gists{/gist_id}","starred_url":"https://api.github.com/users/sandking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandking/subscriptions","organizations_url":"https://api.github.com/users/sandking/orgs","repos_url":"https://api.github.com/users/sandking/repos","events_url":"https://api.github.com/users/sandking/events{/privacy}","received_events_url":"https://api.github.com/users/sandking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-21T09:42:08Z","updated_at":"2016-12-21T09:42:08Z","closed_at":null,"body":"I found that okhttp3 will set the sni automatically.\r\n\r\nIn `RealConnection.java` method `connectTls`\r\n\r\n` if (connectionSpec.supportsTlsExtensions()) {\r\n        Platform.get().configureTlsExtensions(\r\n            sslSocket, address.url().host(), address.protocols());\r\n      }`\r\n\r\nIt will invoke the `configureTlsExtensions` \r\n\r\nAnd , it will select the platform by `private static Platform findPlatform()` in `Platform.java`\r\n\r\nOn Android Platform , `AndroidPlatform.java`\r\n\r\n`      \r\n@Override public void configureTlsExtensions(\r\n      SSLSocket sslSocket, String hostname, List<Protocol> protocols) {\r\n    // Enable SNI and session tickets.\r\n    if (hostname != null) {\r\n      setUseSessionTickets.invokeOptionalWithoutCheckedException(sslSocket, true);\r\n      setHostname.invokeOptionalWithoutCheckedException(sslSocket, hostname);\r\n    }\r\n`\r\n\r\nIt will set the `SNI` by `url.host()`.\r\n\r\nBut , when we use 'httpDns' ,request the server by ip and set the request header `host`\r\n\r\nAnd we want the use the `host` which in request headers. Not use the `host` which from `url.host()`\r\n\r\n"}}
{"actor":{"display_login":"sandking"}}