{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/351","labels_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/351/comments","events_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/351/events","html_url":"https://github.com/OfficeDev/ews-java-api/issues/351","id":88591490,"number":351,"title":"The request failed.Host name does not match the certificate subject provided by the peer ","user":{"login":"805728578","id":9798724,"avatar_url":"https://avatars.githubusercontent.com/u/9798724?v=3","gravatar_id":"","url":"https://api.github.com/users/805728578","html_url":"https://github.com/805728578","followers_url":"https://api.github.com/users/805728578/followers","following_url":"https://api.github.com/users/805728578/following{/other_user}","gists_url":"https://api.github.com/users/805728578/gists{/gist_id}","starred_url":"https://api.github.com/users/805728578/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/805728578/subscriptions","organizations_url":"https://api.github.com/users/805728578/orgs","repos_url":"https://api.github.com/users/805728578/repos","events_url":"https://api.github.com/users/805728578/events{/privacy}","received_events_url":"https://api.github.com/users/805728578/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OfficeDev/ews-java-api/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-16T02:11:27Z","updated_at":"2015-06-18T08:01:53Z","closed_at":null,"body":"```Java\r\nString url = \"https://192.168.0.168/EWS/Exchange.asmx\";\r\nString account = \"*****@**.com\";//\r\nString password = \"****\";//\r\nExchangeCredentials credentials = new WebCredentials(account, password);\r\nExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);\r\nservice.setCredentials(credentials);\r\nservice.setTraceEnabled(true);\r\nservice.setUrl(new URI(url));//\r\nservice.setPreAuthenticate(true);\r\nservice.setTimeout(10*60*1000);\r\n```\r\nthe result:\r\n```Exception\r\ncom.wafersystems.exchange.core.exception.service.remote.ServiceRequestException: The request failed. The request failed. Host name '192.168.0.168' does not match the certificate subject provided by the peer (CN=exchange)\r\n\tat com.wafersystems.exchange.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:74)\r\n\tat com.wafersystems.exchange.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:158)\r\n\tat com.wafersystems.exchange.core.ExchangeService.findItems(ExchangeService.java:981)\r\n\tat com.wafersystems.exchange.core.ExchangeService.findItems(ExchangeService.java:1025)\r\n\tat com.wafersystems.exchange.core.ExchangeService.findItems(ExchangeService.java:1100)\r\n\tat com.wafersystems.ExchangeAPI.main(ExchangeAPI.java:53)\r\nCaused by: com.wafersystems.exchange.core.exception.service.remote.ServiceRequestException: The request failed. Host name '192.168.0.168' does not match the certificate subject provided by the peer (CN=exchange)\r\n\tat com.wafersystems.exchange.core.request.ServiceRequestBase.getEwsHttpWebResponse(ServiceRequestBase.java:729)\r\n\tat com.wafersystems.exchange.core.request.ServiceRequestBase.validateAndEmitRequest(ServiceRequestBase.java:639)\r\n\tat com.wafersystems.exchange.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:62)\r\n\t... 5 more\r\nCaused by: javax.net.ssl.SSLPeerUnverifiedException: Host name '192.168.0.168' does not match the certificate subject provided by the peer (CN=exchange)\r\n\tat org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:465)\r\n\tat org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:395)\r\n\tat org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)\r\n\tat org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)\r\n\tat org.apache.http.impl.conn.BasicHttpClientConnectionManager.connect(BasicHttpClientConnectionManager.java:338)\r\n\tat org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)\r\n\tat org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)\r\n\tat org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)\r\n\tat org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)\r\n\tat org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)\r\n\tat org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)\r\n\tat org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)\r\n\tat com.wafersystems.exchange.core.request.HttpClientWebRequest.executeRequest(HttpClientWebRequest.java:292)\r\n\tat com.wafersystems.exchange.core.request.ServiceRequestBase.getEwsHttpWebResponse(ServiceRequestBase.java:720)\r\n\t... 7 more\r\n```"},"comment":{"url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/comments/113068232","html_url":"https://github.com/OfficeDev/ews-java-api/issues/351#issuecomment-113068232","issue_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/351","id":113068232,"user":{"login":"serious6","id":3902037,"avatar_url":"https://avatars.githubusercontent.com/u/3902037?v=3","gravatar_id":"","url":"https://api.github.com/users/serious6","html_url":"https://github.com/serious6","followers_url":"https://api.github.com/users/serious6/followers","following_url":"https://api.github.com/users/serious6/following{/other_user}","gists_url":"https://api.github.com/users/serious6/gists{/gist_id}","starred_url":"https://api.github.com/users/serious6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serious6/subscriptions","organizations_url":"https://api.github.com/users/serious6/orgs","repos_url":"https://api.github.com/users/serious6/repos","events_url":"https://api.github.com/users/serious6/events{/privacy}","received_events_url":"https://api.github.com/users/serious6/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T08:01:53Z","updated_at":"2015-06-18T08:01:53Z","body":"Maybe try using your own hostname verifier. Can be seen on the [wiki](https://github.com/OfficeDev/ews-java-api/wiki/Custom-Exchange-services)"}}