Skip to content

Commit 98c6ec8

Browse files
committed
Don't test for SSL_set_alpn_protos, present in all supported OpenSSL versions
1 parent 9fc9e6e commit 98c6ec8

File tree

5 files changed

+0
-42
lines changed

5 files changed

+0
-42
lines changed

ncat/ncat_connect.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ static void set_ssl_ctx_options(SSL_CTX *ctx)
194194
bye("Unable to set OpenSSL cipher list: %s", ERR_error_string(ERR_get_error(), NULL));
195195
}
196196

197-
#ifdef HAVE_ALPN_SUPPORT
198-
199197
if (o.sslalpn) {
200198
size_t alpn_len;
201199
unsigned char *alpn = next_protos_parse(&alpn_len, o.sslalpn);
@@ -215,8 +213,6 @@ static void set_ssl_ctx_options(SSL_CTX *ctx)
215213
free(alpn);
216214
}
217215

218-
#endif
219-
220216
}
221217
#endif
222218

ncat/ncat_main.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,10 @@ int main(int argc, char *argv[])
509509
o.ssl = 1;
510510
o.sslservername = Strdup(optarg);
511511
}
512-
#ifdef HAVE_ALPN_SUPPORT
513512
else if (strcmp(long_options[option_index].name, "ssl-alpn") == 0) {
514513
o.ssl = 1;
515514
o.sslalpn = Strdup(optarg);
516515
}
517-
#else
518-
else if (strcmp(long_options[option_index].name, "ssl-alpn") == 0) {
519-
bye("OpenSSL does not have ALPN support compiled in. The --ssl-alpn option cannot be chosen.");
520-
}
521-
#endif
522516
#else
523517
else if (strcmp(long_options[option_index].name, "ssl-cert") == 0) {
524518
bye("OpenSSL isn't compiled in. The --ssl-cert option cannot be chosen.");

nsock/include/nsock_config.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
#undef HAVE_NETDB_H
8080

8181
#undef HAVE_OPENSSL
82-
#undef HAVE_ALPN_SUPPORT
8382

8483
#undef HAVE_EPOLL
8584
#undef HAVE_POLL

nsock/src/configure

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4914,33 +4914,6 @@ if test "$use_openssl" = "yes"; then
49144914
$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
49154915
49164916
OPENSSL_LIBS="-lssl -lcrypto"
4917-
LIBS_TMP="$LIBS"
4918-
LIBS="$OPENSSL_LIBS $LIBS"
4919-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_set_alpn_protos" >&5
4920-
$as_echo_n "checking for SSL_set_alpn_protos... " >&6; }
4921-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4922-
/* end confdefs.h. */
4923-
#include <openssl/ssl.h>
4924-
int
4925-
main ()
4926-
{
4927-
SSL_set_alpn_protos(NULL, NULL, 0)
4928-
;
4929-
return 0;
4930-
}
4931-
_ACEOF
4932-
if ac_fn_c_try_link "$LINENO"; then :
4933-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4934-
$as_echo "yes" >&6; };
4935-
$as_echo "#define HAVE_ALPN_SUPPORT 1" >>confdefs.h
4936-
4937-
else
4938-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4939-
$as_echo "no" >&6; }
4940-
fi
4941-
rm -f core conftest.err conftest.$ac_objext \
4942-
conftest$ac_exeext conftest.$ac_ext
4943-
LIBS="$LIBS_TMP"
49444917
49454918
fi
49464919

nsock/src/configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ if test "$use_openssl" = "yes"; then
270270
OPENSSL_LIBS="-lssl -lcrypto"
271271
LIBS_TMP="$LIBS"
272272
LIBS="$OPENSSL_LIBS $LIBS"
273-
AC_MSG_CHECKING([for SSL_set_alpn_protos])
274-
AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_set_alpn_protos(NULL, NULL, 0)],
275-
[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_ALPN_SUPPORT, 1, [SSL ALPN protos support])],
276-
[AC_MSG_RESULT([no])])
277273
LIBS="$LIBS_TMP"
278274

279275
fi

0 commit comments

Comments
 (0)