mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-10 12:29:49 +03:00
less optional around ssl (#10558)
* less optional * clean up cruft * more * more * just a little less optional
This commit is contained in:
parent
6e499e0e62
commit
aead84a346
@ -124,7 +124,7 @@ class DaemonProxy:
|
||||
return await self._get(request)
|
||||
|
||||
|
||||
async def connect_to_daemon(self_hostname: str, daemon_port: int, ssl_context: Optional[ssl.SSLContext]) -> DaemonProxy:
|
||||
async def connect_to_daemon(self_hostname: str, daemon_port: int, ssl_context: ssl.SSLContext) -> DaemonProxy:
|
||||
"""
|
||||
Connect to the local daemon.
|
||||
"""
|
||||
|
@ -42,7 +42,7 @@ def ssl_context_for_server(
|
||||
*,
|
||||
check_permissions: bool = True,
|
||||
log: Optional[logging.Logger] = None,
|
||||
) -> Optional[ssl.SSLContext]:
|
||||
) -> ssl.SSLContext:
|
||||
if check_permissions:
|
||||
verify_ssl_certs_and_keys([ca_cert, private_cert_path], [ca_key, private_key_path], log)
|
||||
|
||||
@ -70,7 +70,7 @@ def ssl_context_for_server(
|
||||
|
||||
def ssl_context_for_root(
|
||||
ca_cert_file: str, *, check_permissions: bool = True, log: Optional[logging.Logger] = None
|
||||
) -> Optional[ssl.SSLContext]:
|
||||
) -> ssl.SSLContext:
|
||||
if check_permissions:
|
||||
verify_ssl_certs_and_keys([Path(ca_cert_file)], [], log)
|
||||
|
||||
@ -86,7 +86,7 @@ def ssl_context_for_client(
|
||||
*,
|
||||
check_permissions: bool = True,
|
||||
log: Optional[logging.Logger] = None,
|
||||
) -> Optional[ssl.SSLContext]:
|
||||
) -> ssl.SSLContext:
|
||||
if check_permissions:
|
||||
verify_ssl_certs_and_keys([ca_cert, private_cert_path], [ca_key, private_key_path], log)
|
||||
|
||||
|
@ -353,7 +353,7 @@ class BlockTools:
|
||||
def config(self) -> Dict:
|
||||
return copy.deepcopy(self._config)
|
||||
|
||||
def get_daemon_ssl_context(self) -> Optional[ssl.SSLContext]:
|
||||
def get_daemon_ssl_context(self) -> ssl.SSLContext:
|
||||
crt_path = self.root_path / self.config["daemon_ssl"]["private_crt"]
|
||||
key_path = self.root_path / self.config["daemon_ssl"]["private_key"]
|
||||
ca_cert_path = self.root_path / self.config["private_ssl_ca"]["crt"]
|
||||
|
Loading…
Reference in New Issue
Block a user