|
3 | 3 | import importlib |
4 | 4 | import logging |
5 | 5 | import os |
6 | | -import ssl as tls |
| 6 | +import ssl |
7 | 7 |
|
8 | 8 | from .entrypoints import run_as_node, run_as_controller, run_as_ping, run_as_send |
9 | 9 | from .exceptions import ReceptorRuntimeError, ReceptorConfigError |
@@ -58,7 +58,6 @@ def __init__(self, args=None): |
58 | 58 | self.add_config_option( |
59 | 59 | section='default', |
60 | 60 | key='node_id', |
61 | | - #long_option='--node-id', |
62 | 61 | default_value='', |
63 | 62 | value_type='str', |
64 | 63 | hint='Set/override node identifier. If unspecified here or in a config file, one will be automatically generated.', |
@@ -91,19 +90,19 @@ def __init__(self, args=None): |
91 | 90 | # so all of these options use `subparse=False`. |
92 | 91 | self.add_config_option( |
93 | 92 | section='auth', |
94 | | - key='tls_cert', |
| 93 | + key='ssl_cert', |
95 | 94 | default_value='', |
96 | 95 | value_type='str', |
97 | 96 | subparse=False, |
98 | | - hint='Path to the TLS certificate chain file.', |
| 97 | + hint='Path to the SSL/TLS certificate chain file.', |
99 | 98 | ) |
100 | 99 | self.add_config_option( |
101 | 100 | section='auth', |
102 | | - key='tls_key', |
| 101 | + key='ssl_key', |
103 | 102 | default_value='', |
104 | 103 | value_type='str', |
105 | 104 | subparse=False, |
106 | | - hint='Path to the TLS certificate key file.', |
| 105 | + hint='Path to the SSL/TLS certificate key file.', |
107 | 106 | ) |
108 | 107 | # Receptor node options |
109 | 108 | self.add_config_option( |
@@ -375,18 +374,18 @@ def go(self): |
375 | 374 | self._parsed_args.func(self) |
376 | 375 |
|
377 | 376 |
|
378 | | - def get_client_tls_context(self): |
379 | | - if self.auth_tls_cert: |
| 377 | + def get_client_ssl_context(self): |
| 378 | + if self.auth_ssl_cert: |
380 | 379 | logger.debug("Loading SSL Client Context") |
381 | | - return tls.create_default_context(tls.Purpose.SERVER_AUTH, cafile=self.auth_tls_cert) |
| 380 | + return ssl.create_default_context(ssl.Purpose.SERVER_AUTH, cafile=self.auth_ssl_cert) |
382 | 381 | else: |
383 | 382 | return None |
384 | 383 |
|
385 | | - def get_server_tls_context(self): |
386 | | - if self.auth_tls_cert and self.auth_tls_key: |
| 384 | + def get_server_ssl_context(self): |
| 385 | + if self.auth_ssl_cert and self.auth_ssl_key: |
387 | 386 | logger.debug("Loading SSL Server Context") |
388 | | - sc = tls.create_default_context(tls.Purpose.CLIENT_AUTH) |
389 | | - sc.load_cert_chain(self.auth_tls_cert, self.auth_tls_key) |
| 387 | + sc = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) |
| 388 | + sc.load_cert_chain(self.auth_ssl_cert, self.auth_ssl_key) |
390 | 389 | return sc |
391 | 390 | else: |
392 | 391 | return None |
|
0 commit comments