Test that clnrest reuses `cln-grpc` plugin certificates if available. Defaults: - clnrest-protocol: https
(node_factory)
| 58 | |
| 59 | |
| 60 | def test_uses_grpc_plugin_certificates(node_factory): |
| 61 | """Test that clnrest reuses `cln-grpc` plugin certificates if available. |
| 62 | Defaults: |
| 63 | - clnrest-protocol: https |
| 64 | """ |
| 65 | rest_host = 'localhost' |
| 66 | grpc_port = str(node_factory.get_unused_port()) |
| 67 | rest_port = str(node_factory.get_unused_port()) |
| 68 | l1 = node_factory.get_node(options={'grpc-port': grpc_port, 'clnrest-host': rest_host, 'clnrest-port': rest_port}) |
| 69 | base_url = f'https://{rest_host}:{rest_port}' |
| 70 | # This might happen really early! |
| 71 | l1.daemon.logsearch_start = 0 |
| 72 | l1.daemon.wait_for_logs([r'serving grpc on', |
| 73 | r'plugin-clnrest: REST server running at ' + base_url]) |
| 74 | ca_cert = Path(l1.daemon.lightning_dir) / TEST_NETWORK / 'ca.pem' |
| 75 | http_session = http_session_with_retry() |
| 76 | response = http_session.get(base_url + '/v1/list-methods', verify=ca_cert) |
| 77 | assert response.status_code == 200 |
| 78 | |
| 79 | |
| 80 | def test_generate_certificate(node_factory): |
nothing calls this directly
no test coverage detected