Skip to content

Commit

Permalink
net/http_ping: Update to 20160309
Browse files Browse the repository at this point in the history
A patch has been added to fix a TLS negotiation failure when
connecting a server with SNI.

PR:	276186
  • Loading branch information
hrs-allbsd committed Feb 8, 2024
1 parent 6b8a2f9 commit 9b2e6bb
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 26 deletions.
12 changes: 7 additions & 5 deletions net/http_ping/Makefile
@@ -1,21 +1,23 @@
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}
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>
5 changes: 3 additions & 2 deletions 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
37 changes: 18 additions & 19 deletions 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
Expand Down
28 changes: 28 additions & 0 deletions 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;

0 comments on commit 9b2e6bb

Please sign in to comment.