Use bytes for server credentials as well.

This commit is contained in:
Piv
2019-11-17 17:36:54 +10:30
parent 43d8ed3515
commit 070a87f285

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 = open(pvtKeyPath, 'rb').read()
pvtCertBytes = open(pvtCertPath, 'rb').read()
return grpc.ssl_server_credentials([[pvtKeyBytes, pvtCertBytes]])