Import of pkgsrc-2014Q1

This commit is contained in:
2014-11-05 12:41:07 +01:00
parent 785076ae39
commit 9a8c06dafb
19365 changed files with 828089 additions and 278039 deletions
+10 -2
View File
@@ -1,4 +1,4 @@
/* $NetBSD: common.c,v 1.27 2010/06/13 21:38:09 joerg Exp $ */
/* $NetBSD: common.c,v 1.29 2014/01/08 20:25:34 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
@@ -431,7 +431,7 @@ fetch_cache_put(conn_t *conn, int (*closecb)(conn_t *))
* Enable SSL on a connection.
*/
int
fetch_ssl(conn_t *conn, int verbose)
fetch_ssl(conn_t *conn, const struct url *URL, int verbose)
{
#ifdef WITH_SSL
@@ -453,6 +453,14 @@ fetch_ssl(conn_t *conn, int verbose)
return (-1);
}
SSL_set_fd(conn->ssl, conn->sd);
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
if (!SSL_set_tlsext_host_name(conn->ssl, (char *)(uintptr_t)URL->host)) {
fprintf(stderr,
"TLS server name indication extension failed for host %s\n",
URL->host);
return (-1);
}
#endif
if (SSL_connect(conn->ssl) == -1){
ERR_print_errors_fp(stderr);
return (-1);