import grpc
import chanterelle_pb2
import chanterelle_pb2_grpc

channel = grpc.insecure_channel('nftapi.ctf:50052')
stub = chanterelle_pb2_grpc.ChanterelleStub(channel)

result = stub.CAPrinter(
    chanterelle_pb2.google_dot_protobuf_dot_empty__pb2.Empty())

with open("ca.pem", "w") as file:
    file.write(result.ca)

print(result.flag)
