diff --git a/grpclib/client.py b/grpclib/client.py index ba4a549..a47b038 100644 --- a/grpclib/client.py +++ b/grpclib/client.py @@ -752,10 +752,8 @@ class Channel: ctx.options |= (_ssl.OP_NO_TLSv1 | _ssl.OP_NO_TLSv1_1) ctx.set_ciphers('ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20') ctx.set_alpn_protocols(['h2']) - try: + if _ssl.HAS_NPN: ctx.set_npn_protocols(['h2']) - except NotImplementedError: - pass return ctx