Skip to content

Instantly share code, notes, and snippets.

@DimaSamodurov
Created September 4, 2012 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DimaSamodurov/3620627 to your computer and use it in GitHub Desktop.
Save DimaSamodurov/3620627 to your computer and use it in GitHub Desktop.
Connection to exchange web services with NTML auth
# https://github.com/macks/ruby-ntlm
require 'ntlm/http'
require 'open-uri'
require 'net/https'
http = Net::HTTP.new(host, 443)
http.use_ssl = true
http.verify_mode = OpenSSL:SSL::VERIFY_NONE
request = Net::HTTP::Get.new('/ews/Services.wsdl')
request.ntlm_auth(user, domain, pwd)
response = http.request(request)
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment