From: Tim Stephenson on
Hi

I'm sorry to be asking questions on such and old thread. But I am having
similar problems. I've gotten the CA_CERT by exporting it with Firefox
from the EWS server that I am trying to connect to. The thing I am stuck
on is the CERT_FILE. How do I get this file. And why is the same file
used in both of the parameters. The method seems to be expecting a key
and a certificate.

I've tried generating my own private key but no luck. If I leave the
set_client_cert_file line out I don't get any errors regarding the
certificate, but I get a 401 response from the server.

Any advice would be appreciated.



> CERT_FILE = "c:/certs/jim_nopw2.pem"
> CA_CERT = "c:/ca_certs/servers_ca.cer"
>
> require 'rubygems'
> require 'httpclient' # using v2.1.2 and rubyntlm 0.1.1 installed
>
> client = HTTPClient.new
> client.ssl_config.set_trust_ca(CA_CERT)
> client.ssl_config.set_client_cert_file(CERT_FILE, CERT_FILE)
>
> client.set_auth(nil, 'DOMAIN\username', 'password')
>
> resp = client.get("https://some_website.com/default1.asp")
> puts resp.content
> puts resp.status
>
--
Posted via http://www.ruby-forum.com/.