@@ -115,10 +115,10 @@ def async_identity(use_mtls, request, event_loop):
115115 )
116116
117117
118- dir = os .path .dirname (__file__ )
119- with open (os .path .join (dir , "../cert/mtls.crt" ), "rb" ) as fh :
118+ base_dir = os .path .dirname (__file__ )
119+ with open (os .path .join (base_dir , "../cert/mtls.crt" ), "rb" ) as fh :
120120 cert = fh .read ()
121- with open (os .path .join (dir , "../cert/mtls.key" ), "rb" ) as fh :
121+ with open (os .path .join (base_dir , "../cert/mtls.key" ), "rb" ) as fh :
122122 key = fh .read ()
123123
124124ssl_credentials = grpc .ssl_channel_credentials (
@@ -481,9 +481,9 @@ def intercepted_echo_rest(use_mtls):
481481 interceptor = interceptor ,
482482 )
483483 if use_mtls :
484- dir = os .path .dirname (__file__ )
485- cert_path = os .path .join (dir , "../cert/mtls.crt" )
486- key_path = os .path .join (dir , "../cert/mtls.key" )
484+ base_dir = os .path .dirname (__file__ )
485+ cert_path = os .path .join (base_dir , "../cert/mtls.crt" )
486+ key_path = os .path .join (base_dir , "../cert/mtls.key" )
487487 transport ._session .verify = cert_path
488488 transport ._session .cert = (cert_path , key_path )
489489 transport ._session .mount ("https://" , HostNameIgnoringAdapter ())
@@ -508,9 +508,9 @@ def intercepted_echo_rest_async(use_mtls):
508508 interceptor = interceptor ,
509509 )
510510 if use_mtls :
511- dir = os .path .dirname (__file__ )
512- cert_path = os .path .join (dir , "../cert/mtls.crt" )
513- key_path = os .path .join (dir , "../cert/mtls.key" )
511+ base_dir = os .path .dirname (__file__ )
512+ cert_path = os .path .join (base_dir , "../cert/mtls.crt" )
513+ key_path = os .path .join (base_dir , "../cert/mtls.key" )
514514 transport ._session .verify = cert_path
515515 transport ._session .cert = (cert_path , key_path )
516516 transport ._session .mount ("https://" , HostNameIgnoringAdapter ())
0 commit comments