Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm getting back nil for autodiscover #4

Open
retorquere opened this issue May 21, 2015 · 8 comments
Open

I'm getting back nil for autodiscover #4

retorquere opened this issue May 21, 2015 · 8 comments

Comments

@retorquere
Copy link

With this script:

require 'autodiscover'
client = Autodiscover::Client.new(email: "[email protected]", password: "XXXXXXXX")
data = client.autodiscover(ignore_ssl_errors: true)
puts data.response

I'm getting back nil for the autodiscover call. I have to do the ignore, as the certificate doesn't match the domain (the exchange admins say that there's no problem, but eM Client complains about this too).

@zenchild
Copy link
Member

It's returning nil because nothing is resolving. I'm not hung up on this being the correct way to do it but that is the reason you are getting a nil result.

@zenchild
Copy link
Member

I just pushed up a change to master that adds a simple logger. You can include it with require "autodiscover/debug" after you've required autodiscover.

@retorquere
Copy link
Author

It looks like it does resolve, it's just that the first attempt fails for certificate problems rather than the domain not responding (see http://is.gd/TxGOi1)

@retorquere
Copy link
Author

My script is currently this:

#!/usr/bin/env ruby

require 'dotenv/load'

require 'autodiscover'
require "autodiscover/debug"

client = Autodiscover::Client.new(email: ENV['EMAIL'], password: ENV['PASSWORD'], username: ENV['USER'])
data = client.autodiscover(ignore_ssl_errors: true)

if data.nil?
  puts 'no response'
  exit
end

puts data.ews_url
puts data.exchange_version
puts data.response

and the output is

DEBUG  Autodiscover::PoxRequest : Yielding HTTPS Url https://han.nl/autodiscover/autodiscover.xml
DEBUG  Autodiscover::PoxRequest : Yielding HTTPS Url https://autodiscover.han.nl/autodiscover/autodiscover.xml
DEBUG  Autodiscover::PoxRequest : Yielding HTTP Redirected Url https://autodiscover.han.nl/autodiscover/autodiscover.xml
no response

@retorquere
Copy link
Author

I've tried the same account on testconnectivity.microsoft.com, and I'm getting a positive result on https://autodiscover.han.nl:443/Autodiscover/Autodiscover.xml .

@retorquere
Copy link
Author

Got it -- I passed the username as username\domain, but user@domain instead does the job.

@retorquere
Copy link
Author

Yet on another system, I'm getting the old problem again (same script from above):

DEBUG  Autodiscover::PoxRequest : Yielding HTTPS Url https://han.nl/autodiscover/autodiscover.xml
DEBUG  Autodiscover::PoxRequest : Yielding HTTPS Url https://autodiscover.han.nl/autodiscover/autodiscover.xml
DEBUG  Autodiscover::PoxRequest : Yielding HTTP Redirected Url https://autodiscover.han.nl/autodiscover/autodiscover.xml
no response

@retorquere
Copy link
Author

I've enabled debug logging on the embedded httpclient, this is what it shows: https://gist.github.com/eb32d9a02d297191118f55b870ede466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants