Read bytes directly in open

This commit is contained in:
Piv
2019-11-17 17:21:46 +10:30
parent 69caa12fe5
commit 6d3c5fd5ae

View File

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