diff --git a/Modules/_ssl.c b/Modules/_ssl.c index f70af266731ad0..8897c6a4516efa 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2048,7 +2048,7 @@ static PyMethodDef PySSLMethods[] = { PySSL_peercert_doc}, {"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS}, {"version", (PyCFunction)PySSL_version, METH_NOARGS}, -#ifdef OPENSSL_NPN_NEGOTIATED +#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG) {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol, METH_NOARGS}, #endif #ifdef HAVE_ALPN