OLD | NEW |
(Empty) | |
| 1 class PregeneratedSSLEnvironment(object): |
| 2 """SSL environment to use with existing key/certificate files |
| 3 e.g. when running on a server with a public domain name |
| 4 """ |
| 5 ssl_enabled = True |
| 6 |
| 7 def __init__(self, logger, host_key_path, host_cert_path, |
| 8 ca_cert_path=None): |
| 9 self._ca_cert_path = ca_cert_path |
| 10 self._host_key_path = host_key_path |
| 11 self._host_cert_path = host_cert_path |
| 12 |
| 13 def __enter__(self): |
| 14 return self |
| 15 |
| 16 def __exit__(self, *args, **kwargs): |
| 17 pass |
| 18 |
| 19 def host_cert_path(self, hosts): |
| 20 """Return the key and certificate paths for the host""" |
| 21 return self._host_key_path, self._host_cert_path |
| 22 |
| 23 def ca_cert_path(self): |
| 24 """Return the certificate path of the CA that signed the |
| 25 host certificates, or None if that isn't known""" |
| 26 return self._ca_cert_path |
OLD | NEW |