From 070a87f2850ed6698171b6587fa5b3a79e2caf72 Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Sun, 17 Nov 2019 17:36:54 +1030 Subject: [PATCH] Use bytes for server credentials as well. --- MotorControl/MotorServer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MotorControl/MotorServer.py b/MotorControl/MotorServer.py index a2c82c8..5d4983c 100755 --- a/MotorControl/MotorServer.py +++ b/MotorControl/MotorServer.py @@ -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]])