git: 9b2e6bb3ac6a - main - net/http_ping: Update to 20160309

From: Hiroki Sato <hrs_at_FreeBSD.org>
Date: Thu, 08 Feb 2024 02:24:29 UTC
The branch main has been updated by hrs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9b2e6bb3ac6af7758b56de789bad49510bccb05d

commit 9b2e6bb3ac6af7758b56de789bad49510bccb05d
Author:     Hiroki Sato <hrs@FreeBSD.org>
AuthorDate: 2024-02-08 02:17:48 +0000
Commit:     Hiroki Sato <hrs@FreeBSD.org>
CommitDate: 2024-02-08 02:17:48 +0000

    net/http_ping: Update to 20160309
    
    A patch has been added to fix a TLS negotiation failure when
    connecting a server with SNI.
    
    PR:     276186
---
 net/http_ping/Makefile                | 12 +++++++-----
 net/http_ping/distinfo                |  5 +++--
 net/http_ping/files/patch-Makefile    | 37 +++++++++++++++++------------------
 net/http_ping/files/patch-http_ping.c | 28 ++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 26 deletions(-)

diff --git a/net/http_ping/Makefile b/net/http_ping/Makefile
index be27f6fead51..7475c2ebeeac 100644
--- a/net/http_ping/Makefile
+++ b/net/http_ping/Makefile
@@ -1,16 +1,15 @@
 PORTNAME=	http_ping
-PORTVERSION=	20050629
-PORTREVISION=	2
+PORTVERSION=	20160309
 CATEGORIES=	net www
 MASTER_SITES=	http://www.acme.com/software/${PORTNAME}/
-DISTNAME=	${PORTNAME}_29jun2005
+DISTNAME=	${PORTNAME}_09Mar2016
 
 MAINTAINER=	hrs@FreeBSD.org
 COMMENT=	Measure HTTP Latency
 WWW=		https://www.acme.com/software/http_ping/
 
-DEPRECATED=	Supports only HTTP/1.0
-EXPIRATION_DATE=2024-02-29
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		ssl
 WRKSRC=		${WRKDIR}/${PORTNAME}
@@ -18,4 +17,7 @@ CFLAGS+=	-I${OPENSSLINC}
 LDFLAGS+=	-L${OPENSSLLIB}
 PLIST_FILES=	bin/http_ping share/man/man1/http_ping.1.gz
 
+post-extract:
+	cd ${WRKSRC} && ${SED} -e '/^\*\*/,/^\*\//p;d' < http_ping.c > LICENSE
+
 .include <bsd.port.mk>
diff --git a/net/http_ping/distinfo b/net/http_ping/distinfo
index 58f6fa9f6cc8..75bd69cd4d8d 100644
--- a/net/http_ping/distinfo
+++ b/net/http_ping/distinfo
@@ -1,2 +1,3 @@
-SHA256 (http_ping_29jun2005.tar.gz) = f0a68c1d0c418a6333599ea6363e095867cc0472f0c89d000e3ac6f871b8c4d1
-SIZE (http_ping_29jun2005.tar.gz) = 7956
+TIMESTAMP = 1705956056
+SHA256 (http_ping_09Mar2016.tar.gz) = f8b95773aaed09839a44a1927f979a62752d57aace79da3846bfb73e6c9805e9
+SIZE (http_ping_09Mar2016.tar.gz) = 8106
diff --git a/net/http_ping/files/patch-Makefile b/net/http_ping/files/patch-Makefile
index ae1c6f34244d..e0c07dca83b0 100644
--- a/net/http_ping/files/patch-Makefile
+++ b/net/http_ping/files/patch-Makefile
@@ -1,29 +1,28 @@
---- Makefile.orig	2002-01-04 14:50:06.000000000 +0900
-+++ Makefile	2013-10-17 12:39:39.000000000 +0900
-@@ -14,13 +14,15 @@
- #SSL_INC =	-I$(SSL_TREE)/include
+--- Makefile.orig	2014-08-11 19:13:31 UTC
++++ Makefile
+@@ -15,23 +15,26 @@
  #SSL_LIBS =	-L$(SSL_TREE)/lib -lssl -lcrypto
  
--
+ 
 -BINDIR =	/usr/local/bin
 -MANDIR =	/usr/local/man/man1
--CC =		gcc -Wall
--CFLAGS =	-O $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)
-+SSL_DEFS=	-DUSE_SSL ${OPENSSL_CFLAGS}
-+SSL_INC=	-I${OPENSSLINC}
-+SSL_LIBS=	-L${OPENSSLLIB} -lssl -lcrypto
-+BINDIR =	${PREFIX}/bin
-+MANDIR =	${PREFIX}/share/man/man1
-+CC?=		gcc -Wall
-+CFLAGS+=	-g $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)
- #CFLAGS =	-g $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)
+-CC =		cc
+-CFLAGS =	-O $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC) -ansi -pedantic -U__STRICT_ANSI__ -Wall -Wpointer-arith -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wno-long-long
 -LDFLAGS =	-s $(SSL_LIBS) $(SYSV_LIBS)
-+LDFLAGS+=	-s -lssl -lcrypto
- #LDFLAGS =	-g $(SSL_LIBS) $(SYSV_LIBS)
++BINDIR =	${PREFIX}/bin
++MANDIR =	${PREFIX}/share//man/man1
++CC?=		cc
++CFLAGS+=	-O $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)
++LDFLAGS+=	-s $(SSL_LIBS) $(SYSV_LIBS)
  
++SSL_DEFS =	-DUSE_SSL ${OPENSSL_CFLAGS}
++SSL_INC =	-I${OPENSSLINC}
++SSL_LIBS =	-L${OPENSSLLIB} -lssl -lcrypto
++
  all:		http_ping
-@@ -32,11 +34,10 @@
- 	$(CC) $(CFLAGS) -c http_ping.c
+ 
+ http_ping:	http_ping.c port.h
+ 	$(CC) $(CFLAGS) http_ping.c $(LDFLAGS) -o http_ping
  
  
 -install:	all
diff --git a/net/http_ping/files/patch-http_ping.c b/net/http_ping/files/patch-http_ping.c
new file mode 100644
index 000000000000..8a9d822adcb3
--- /dev/null
+++ b/net/http_ping/files/patch-http_ping.c
@@ -0,0 +1,28 @@
+--- http_ping.c.orig	2024-02-08 02:14:24 UTC
++++ http_ping.c
+@@ -424,8 +424,8 @@ start_connection( void )
+ 	    {
+ 	    SSL_load_error_strings();
+ 	    SSLeay_add_ssl_algorithms();
+-	    ssl_ctx = SSL_CTX_new( SSLv23_client_method() );
+-	    SSL_CTX_set_options( ssl_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3 );
++	    ssl_ctx = SSL_CTX_new( TLS_client_method() );
++	    SSL_CTX_set_min_proto_version( ssl_ctx, TLS1_VERSION );
+ 	    }
+ 	if ( ! RAND_status() )
+ 	    {
+@@ -437,11 +437,13 @@ start_connection( void )
+ 	    }
+ 	ssl = SSL_new( ssl_ctx );
+ 	SSL_set_fd( ssl, conn_fd );
++	SSL_set_tlsext_host_name(ssl, url_host);
+ 	r = SSL_connect( ssl );
+ 	if ( r <= 0 )
+ 	    {
+ 	    (void) fprintf(
+-		stderr, "%s: SSL connection failed - %d\n", argv0, r );
++		stderr, "%s: SSL connection failed - %d\n", argv0,
++		SSL_get_error(ssl, r));
+ 	    ERR_print_errors_fp( stderr );
+ 	    close_connection();
+ 	    return 0;