Use string rather than bytes for server credentials.

This commit is contained in:
Piv
2019-11-17 17:25:13 +10:30
parent 4a6bd8bd64
commit e90033c7cc

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