Test that self-signed certificates have `clnrest-host` IP in Subject Alternative Name.
(node_factory)
| 40 | |
| 41 | |
| 42 | def test_self_signed_certificates(node_factory): |
| 43 | """Test that self-signed certificates have `clnrest-host` IP in Subject Alternative Name.""" |
| 44 | rest_port = str(node_factory.get_unused_port()) |
| 45 | rest_host = '127.0.0.1' |
| 46 | base_url = f'https://{rest_host}:{rest_port}' |
| 47 | l1 = node_factory.get_node(options={'disable-plugin': 'cln-grpc', |
| 48 | 'clnrest-port': rest_port, |
| 49 | 'clnrest-host': rest_host}) |
| 50 | # This might happen really early! |
| 51 | l1.daemon.logsearch_start = 0 |
| 52 | l1.daemon.wait_for_log(r'plugin-clnrest: REST server running at ' + base_url) |
| 53 | ca_cert = Path(l1.daemon.lightning_dir) / TEST_NETWORK / 'ca.pem' |
| 54 | |
| 55 | http_session = http_session_with_retry() |
| 56 | response = http_session.get(base_url + '/v1/list-methods', verify=ca_cert) |
| 57 | assert response.status_code == 200 |
| 58 | |
| 59 | |
| 60 | def test_uses_grpc_plugin_certificates(node_factory): |
nothing calls this directly
no test coverage detected