Такой вопрос, при компиляции, вылезает ошибка на функцию, все прикрепил ниже
def run():
call_credentials = grpc.metadata_call_credentials(metadata_plugin)
ssl_ch_creds = grpc.ssl_channel_credentials(root_certificates=ssl_root_cert,
private_key=ssl_private_key,
certificate_chain=ssl_cert_chain) //на это ругается
comp_ch_creds = grpc.composite_channel_credentials(ssl_ch_creds, call_credentials)
channel = grpc.secure_channel('grpc.api.lar.tech:9021', comp_ch_creds)
channel.subscribe(channel_status_callback, try_to_connect=True)
stub = grpc_adpt_pb2_grpc.GrpcAdapterStub(channel)
try:
for response in stub.streamData(downlink_stream()):
process_uplink_msg(response)
except KeyboardInterrupt:
print("shut down after keyboard interrupt.")
except grpc._channel._Rendezvous as err:
print(err)
print("Finish.")
if __name__ == '__main__':
run()
Такая вот ошибка
Traceback (most recent call last):
File "C:/Users/djolo/PycharmProjects/LoRa/lora.py", line 88, in <module>
run()
File "C:/Users/djolo/PycharmProjects/LoRa/lora.py", line 70, in run
certificate_chain=ssl_cert_chain)
File "C:\Users\djolo\PycharmProjects\lora\venv\lib\site-packages\grpc\__init__.py", line 1570, in ssl_channel_credentials
certificate_chain))
Это файл __init__.py
def ssl_channel_credentials(root_certificates=None,
private_key=None,
certificate_chain=None):
root_certificates: The PEM-encoded root certificates as a byte string,
or None to retrieve them from a default location chosen by gRPC
runtime.
private_key: The PEM-encoded private key as a byte string, or None if no
private key should be used.
certificate_chain: The PEM-encoded certificate chain as a byte string
to use or or None if no certificate chain should be used
return ChannelCredentials(
_cygrpc.SSLChannelCredentials(root_certificates, private_key,
certificate_chain))
И вырезка того, как я вставляю файлы ключей
ssl_root_cert = open('c:\keys\prootCA.crt').read()
ssl_cert_chain = open('c:\keys\certificate.crt').read()
ssl_private_key = open('c:\keys\private_key.pem').read()
И я вот не понимаю на что именно он ругается. Вроде все так как в описании функции