- Update to the latest GitHub commit: current version is from 2015

and is not compatible with modern OpenSSL implementations
- Set PORTVERSION to the version number as reported by `httperf -V'
- Increase buffer size in do_recv() to match TLS record size which
  can be up to 16kB [1]
- When using TLS 1.1 or TLS 1.2, the first SSL_connect() may often
  return error, while subsequent requests work fine -- to mitigate
  this, try to SSL_connect() a little harder [2]

Approved by:	maintainer timeout

PR:	230680 [1], 230681 [2]
This commit is contained in:
Alexey Dokuchaev 2019-12-07 11:39:35 +00:00
parent 59fe6b4d59
commit 9a71a9819f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=519200
4 changed files with 36 additions and 57 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= httperf
PORTVERSION= 0.9.0.1
PORTVERSION= 0.9.1
CATEGORIES= benchmarks www
MAINTAINER= jlaffaye@FreeBSD.org
@ -13,7 +13,7 @@ LICENSE= GPLv2
GNU_CONFIGURE= yes
USES= autoreconf gmake libtool ssl
USE_GITHUB= yes
GH_TAGNAME= dcfb746
GH_TAGNAME= 568322e
MAKE_ARGS= LIBUTIL_OBJS=ssl_writev.o \
exec_prefix=${PREFIX}
@ -23,13 +23,6 @@ PORTDOCS= ChangeLog NEWS README TODO
OPTIONS_DEFINE= DOCS
.include <bsd.port.pre.mk>
.if ${SSL_DEFAULT} == base
BROKEN_FreeBSD_12= error: incomplete definition of type 'struct ssl_cipher_st'
BROKEN_FreeBSD_13= error: incomplete definition of type 'struct ssl_cipher_st'
.endif
do-install:
${INSTALL_MAN} ${WRKSRC}/man/${PORTNAME}.1 \
${STAGEDIR}${MAN1PREFIX}/man/man1
@ -39,4 +32,4 @@ do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -1,2 +1,3 @@
SHA256 (httperf-httperf-0.9.0.1-dcfb746_GH0.tar.gz) = 72294a3cbfd78b48f38b077f7a380ef24b69f3bc24f6ec87875f2f069153677d
SIZE (httperf-httperf-0.9.0.1-dcfb746_GH0.tar.gz) = 103950
TIMESTAMP = 1567099566
SHA256 (httperf-httperf-0.9.1-568322e_GH0.tar.gz) = 03fea35c6a1ce4c4a5461b45708659ffc48906b63816721eec20cc01f9d2d1c0
SIZE (httperf-httperf-0.9.1-568322e_GH0.tar.gz) = 107694

View file

@ -1,45 +0,0 @@
--- src/httperf.c
+++ src/httperf.c
@@ -664,10 +664,14 @@ main(int argc, char **argv)
{
if (strcasecmp (optarg, "auto") == 0)
param.ssl_protocol = 0;
+#ifndef OPENSSL_NO_SSL2
else if (strcasecmp (optarg, "SSLv2") == 0)
param.ssl_protocol = 2;
+#endif
+#ifndef OPENSSL_NO_SSL3
else if (strcasecmp (optarg, "SSLv3") == 0)
param.ssl_protocol = 3;
+#endif
else if (strcasecmp (optarg, "TLSv1") == 0)
param.ssl_protocol = 4;
else
@@ -997,10 +1001,14 @@ main(int argc, char **argv)
{
/* 0/auto for SSLv23 */
case 0: ssl_ctx = SSL_CTX_new (SSLv23_client_method ()); break;
+#ifndef OPENSSL_NO_SSL2
/* 2/SSLv2 */
case 2: ssl_ctx = SSL_CTX_new (SSLv2_client_method ()); break;
+#endif
+#ifndef OPENSSL_NO_SSL3
/* 3/SSLv3 */
case 3: ssl_ctx = SSL_CTX_new (SSLv3_client_method ()); break;
+#endif
/* 4/TLSv1 */
case 4: ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break;
}
@@ -1204,8 +1212,12 @@ main(int argc, char **argv)
switch (param.ssl_protocol)
{
case 0: printf (" --ssl-protocol=auto"); break;
+#ifndef OPENSSL_NO_SSL2
case 2: printf (" --ssl-protocol=SSLv2"); break;
+#endif
+#ifndef OPENSSL_NO_SSL3
case 3: printf (" --ssl-protocol=SSLv3"); break;
+#endif
case 4: printf (" --ssl-protocol=TLSv1"); break;
}
#endif

View file

@ -0,0 +1,30 @@
--- src/core.c.orig 2019-08-29 17:26:06 UTC
+++ src/core.c
@@ -651,7 +651,7 @@ recv_done(Call * call)
static void
do_recv(Conn * s)
{
- char *cp, buf[8193];
+ char *cp, buf[16385];
Call *c = s->recvq;
int i, saved_errno;
ssize_t nread = 0;
@@ -1062,8 +1062,7 @@ core_ssl_connect(Conn * s)
exit(-1);
}
- ssl_err = SSL_connect(s->ssl);
- if (ssl_err < 0) {
+ while ((ssl_err = SSL_connect(s->ssl)) < 0) {
int reason = SSL_get_error(s->ssl, ssl_err);
if (reason == SSL_ERROR_WANT_READ
@@ -1083,7 +1082,7 @@ core_ssl_connect(Conn * s)
clear_active(s, READ);
set_active(s, WRITE);
}
- return;
+ continue;
}
fprintf(stderr,
"%s: failed to connect to SSL server (err=%d, reason=%d)\n",