{"action":"created","issue":{"url":"https://api.github.com/repos/WinRb/autodiscover/issues/3","labels_url":"https://api.github.com/repos/WinRb/autodiscover/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/WinRb/autodiscover/issues/3/comments","events_url":"https://api.github.com/repos/WinRb/autodiscover/issues/3/events","html_url":"https://github.com/WinRb/autodiscover/issues/3","id":75253477,"number":3,"title":"OpenSSL::SSL::SSLError","user":{"login":"errinlarsen","id":10176,"avatar_url":"https://avatars.githubusercontent.com/u/10176?v=3","gravatar_id":"","url":"https://api.github.com/users/errinlarsen","html_url":"https://github.com/errinlarsen","followers_url":"https://api.github.com/users/errinlarsen/followers","following_url":"https://api.github.com/users/errinlarsen/following{/other_user}","gists_url":"https://api.github.com/users/errinlarsen/gists{/gist_id}","starred_url":"https://api.github.com/users/errinlarsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errinlarsen/subscriptions","organizations_url":"https://api.github.com/users/errinlarsen/orgs","repos_url":"https://api.github.com/users/errinlarsen/repos","events_url":"https://api.github.com/users/errinlarsen/events{/privacy}","received_events_url":"https://api.github.com/users/errinlarsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-11T15:09:06Z","updated_at":"2015-05-11T18:17:30Z","closed_at":null,"body":"I realize this is a very new gem. Thanks for your work!\r\n\r\nI've been spiking recently on integrating Viewpoint into my app and I recently decided I'd like to integrate use of Exchange's Autodiscovery so my user's wouldn't need to know their EWS endpoints.\r\n\r\nThat being said, I experienced the following while playing with this gem:\r\n\r\n```Ruby\r\nclient = Autodiscover::Client.new(email: user.email, password: user.password)\r\n#=> #<Autodiscover::Client:0x007ff4c8413768 ...<details snipped>...>\r\n\r\ndata = client.autodiscover\r\n#=> OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed\r\n#   from /Code/ews_poc/vendor/bundle/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:307:in `connect'\r\n```\r\n\r\nI haven't had to deal with server certificates at all while playing with your `WinRb/Viewpoint' gem, so I thought this might be a \"new gem; version 0.1.0; all-of-the-things don't work yet!\" kinda thing.\r\n\r\nOn a whim, I did the following:\r\n\r\n```Ruby\r\npox_request = Autodiscover::PoxRequest.new(client)\r\n# => #<Autodiscover::PoxRequest:0x007ff4c4af9b80 ...<details snipped>...>\r\n\r\npox_request.send(:request_body)\r\n#=> \"<?xml version=\\\"1.0\\\"?>\\n<Autodiscover xmlns=\\\"http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006\\\">\\n  <Request>\\n    <EMailAddress>holleyb@advisory.com</EMailAddress>\\n    <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>\\n  </Request>\\n</Autodiscover>\\n\"\r\n\r\npox_request.send(:available_urls).to_a\r\n#=> [\"https://advisory.com/autodiscover/autodiscover.xml\", \"https://autodiscover.advisory.com/autodiscover/autodiscover.xml\", nil]\r\n\r\npox_request.instance_variable_get(:@formatted_urls)\r\n#=> [\"https://users_domain.com/autodiscover/autodiscover.xml\", \"https://autodiscover.users_domain.com/autodiscover/autodiscover.xml\"]\r\n\r\npox_request.instance_variable_get(:@formatted_urls).each { |url| url.gsub!(/https/, 'http') }\r\n=> [\"http://users_domain.com/autodiscover/autodiscover.xml\", \"http://autodiscover.users_domain.com/autodiscover/autodiscover.xml\"]\r\n\r\nresponse = pox_request.autodiscover\r\n#=> #<Autodiscover::PoxResponse:0x007ff4caaca488 ...<details snipped>...>\r\n\r\nresponse.ews_url\r\n#=> \"https://mail.users_domain.com/ews/exchange.asmx\"\r\n```\r\n\r\nShould I expect that I need to deal with server certificates? Is the gem supposed to handle this sort of thing but it just isn't handled yet?"},"comment":{"url":"https://api.github.com/repos/WinRb/autodiscover/issues/comments/101004085","html_url":"https://github.com/WinRb/autodiscover/issues/3#issuecomment-101004085","issue_url":"https://api.github.com/repos/WinRb/autodiscover/issues/3","id":101004085,"user":{"login":"zenchild","id":89312,"avatar_url":"https://avatars.githubusercontent.com/u/89312?v=3","gravatar_id":"","url":"https://api.github.com/users/zenchild","html_url":"https://github.com/zenchild","followers_url":"https://api.github.com/users/zenchild/followers","following_url":"https://api.github.com/users/zenchild/following{/other_user}","gists_url":"https://api.github.com/users/zenchild/gists{/gist_id}","starred_url":"https://api.github.com/users/zenchild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenchild/subscriptions","organizations_url":"https://api.github.com/users/zenchild/orgs","repos_url":"https://api.github.com/users/zenchild/repos","events_url":"https://api.github.com/users/zenchild/events{/privacy}","received_events_url":"https://api.github.com/users/zenchild/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T18:17:30Z","updated_at":"2015-05-11T18:17:30Z","body":"The reason you are seeing the SSL error is because the https domains that are being tried with Autodiscover have invalid certs for their domain. In the case of **advisory.com** the cert is only valid for **www\\.advisory\\.com** and **autodiscover.advisory.com** has a cert for **mail.advisory.com**. My point being is that this is a misconfiguration for autodiscover. I can add an option to ignore SSL errors but in the meantime you can do one of the following:\r\n\r\n1. Keep those hosts from resolving to an actual web server so autodiscover fails and moves on to the non-https hosts.\r\n2. Get valid certificates for those hosts\r\n3. Turn off SSL verification, knowing that this basically removes any point to SSL.\r\n    * `client.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE`"}}