common.c (253680) | common.c (258347) |
---|---|
1/*- 2 * Copyright (c) 1998-2011 Dag-Erling Sm��rgrav 3 * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998-2011 Dag-Erling Sm��rgrav 3 * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/lib/libfetch/common.c 253680 2013-07-26 15:53:43Z des $"); | 31__FBSDID("$FreeBSD: head/lib/libfetch/common.c 258347 2013-11-19 15:35:26Z bdrewery $"); |
32 33#include <sys/param.h> 34#include <sys/socket.h> 35#include <sys/time.h> 36#include <sys/uio.h> 37 38#include <netinet/in.h> 39 --- 784 unchanged lines hidden (view full) --- 824 return (-1); 825 826 conn->ssl = SSL_new(conn->ssl_ctx); 827 if (conn->ssl == NULL) { 828 fprintf(stderr, "SSL context creation failed\n"); 829 return (-1); 830 } 831 SSL_set_fd(conn->ssl, conn->sd); | 32 33#include <sys/param.h> 34#include <sys/socket.h> 35#include <sys/time.h> 36#include <sys/uio.h> 37 38#include <netinet/in.h> 39 --- 784 unchanged lines hidden (view full) --- 824 return (-1); 825 826 conn->ssl = SSL_new(conn->ssl_ctx); 827 if (conn->ssl == NULL) { 828 fprintf(stderr, "SSL context creation failed\n"); 829 return (-1); 830 } 831 SSL_set_fd(conn->ssl, conn->sd); |
832 833#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) 834 if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) { 835 fprintf(stderr, 836 "TLS server name indication extension failed for host %s\n", 837 URL->host); 838 return (-1); 839 } 840#endif |
|
832 while ((ret = SSL_connect(conn->ssl)) == -1) { 833 ssl_err = SSL_get_error(conn->ssl, ret); 834 if (ssl_err != SSL_ERROR_WANT_READ && 835 ssl_err != SSL_ERROR_WANT_WRITE) { 836 ERR_print_errors_fp(stderr); 837 return (-1); 838 } 839 } --- 581 unchanged lines hidden --- | 841 while ((ret = SSL_connect(conn->ssl)) == -1) { 842 ssl_err = SSL_get_error(conn->ssl, ret); 843 if (ssl_err != SSL_ERROR_WANT_READ && 844 ssl_err != SSL_ERROR_WANT_WRITE) { 845 ERR_print_errors_fp(stderr); 846 return (-1); 847 } 848 } --- 581 unchanged lines hidden --- |