Use bytes rather than str for key and ca

This commit is contained in:
Piv
2019-11-17 17:19:54 +10:30
parent 5d4f0feebf
commit 69caa12fe5

View File

@@ -66,8 +66,8 @@ class MotorServicer(motorService_pb2_grpc.CarControlServicer):
pvtKeyPath = '/home/pi/tls/device.key'
pvtCertPath = '/home/pi/tls/device.crt'
pvtKeyBytes = open(pvtKeyPath).read()
pvtCertBytes = open(pvtCertPath).read()
pvtKeyBytes = bytes(open(pvtKeyPath).read())
pvtCertBytes = bytes(open(pvtCertPath).read())
return grpc.ssl_channel_credentials(pvtCertBytes, pvtKeyBytes)