README.md in etcd-0.2.4 vs README.md in etcd-0.3.0

- old
+ new

@@ -23,9 +23,34 @@ client = Etcd.client(port: 4002) client = Etcd.client(host: '127.0.0.1', port: 4003) client = Etcd.client(:user_name => 'test', :password => 'pwd') # populates the authentication header for basic HTTP auth with user name and password (useful for proxied connections) client = Etcd.client(host: '127.0.0.1', port: 4003, allow_redirect: false) # wont let you run sensitive commands on non-leader machines, default is true ``` + +### Create a client object to connect to a SSL etcd instance + +See [Etcd config](https://github.com/coreos/etcd/blob/master/Documentation/configuration.md) to setup `etcd` in SSL mode. + +Assuming you have these: +* `myca.crt` - Your internal CAs certificate +* `my-cert.crt` - The "client" cert +* `my-cert.key` - The key corresponding to `my-cert.crt` + +If you were using self signed Certs and have your own CA, You would have set `-ca-file` in your etcd config also to use `myca.crt`. + +```ruby +client=Etcd.client( + :host => "your-etcd-host", + :port => 443, + :use_ssl => true, + :ca_file => "/pathto/myca.crt", + :ssl_cert => OpenSSL::X509::Certificate.new( File.read("/pathto/my-cert.crt") ), + :ssl_key => OpenSSL::PKey::RSA.new("/etc/ssl/my-cert.key",passphrase) +) +#Omit passphrase if not set on your key. +``` + + ### Set a key ```ruby client.set('/nodes/n1', value: 1) # with ttl client.set('/nodes/n2', value: 2, ttl: 4) # sets the ttl to 4 seconds