95: def setup_ssl
96: results = {}
97:
98:
99: host = Puppet::SSL::Host.localhost
100:
101: raise Puppet::Error, "Could not retrieve certificate for #{host.name} and not running on a valid certificate authority" unless host.certificate
102:
103: results[:SSLPrivateKey] = host.key.content
104: results[:SSLCertificate] = host.certificate.content
105: results[:SSLStartImmediately] = true
106: results[:SSLEnable] = true
107:
108: raise Puppet::Error, "Could not find CA certificate" unless Puppet::SSL::Certificate.find(Puppet::SSL::CA_NAME)
109:
110: results[:SSLCACertificateFile] = Puppet[:localcacert]
111: results[:SSLVerifyClient] = OpenSSL::SSL::VERIFY_PEER
112:
113: results[:SSLCertificateStore] = host.ssl_store
114:
115: results
116: end