An echo server/client illustrating the use of certificate chains to secure a connection. There are two aspects of interest in this example and missing in other explanations of the problem out there in ruby forums:  1. The commands used to actually create a chain of certificates 2. The configuration of openssl contexts in ruby to verify a certificate  using a chain rather than simply comparing the expected certificate against the certificate received from the server.