|
Lines 1-6
Link Here
|
| 1 |
/* SSL support via OpenSSL library. |
1 |
/* SSL support via OpenSSL library. |
| 2 |
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
2 |
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
| 3 |
2009, 2010, 2011 Free Software Foundation, Inc. |
3 |
2009, 2010, 2011, 2012 Free Software Foundation, Inc. |
| 4 |
Originally contributed by Christian Fraenkel. |
4 |
Originally contributed by Christian Fraenkel. |
| 5 |
|
5 |
|
| 6 |
This file is part of GNU Wget. |
6 |
This file is part of GNU Wget. |
|
Lines 395-401
static struct transport_implementation openssl_transport = {
Link Here
|
| 395 |
Returns true on success, false on failure. */ |
395 |
Returns true on success, false on failure. */ |
| 396 |
|
396 |
|
| 397 |
bool |
397 |
bool |
| 398 |
ssl_connect_wget (int fd) |
398 |
ssl_connect_wget (int fd, const char *hostname) |
| 399 |
{ |
399 |
{ |
| 400 |
SSL *conn; |
400 |
SSL *conn; |
| 401 |
struct openssl_transport_context *ctx; |
401 |
struct openssl_transport_context *ctx; |
|
Lines 406-411
ssl_connect_wget (int fd)
Link Here
|
| 406 |
conn = SSL_new (ssl_ctx); |
406 |
conn = SSL_new (ssl_ctx); |
| 407 |
if (!conn) |
407 |
if (!conn) |
| 408 |
goto error; |
408 |
goto error; |
|
|
409 |
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) |
| 410 |
/* If the SSL library was build with support for ServerNameIndication |
| 411 |
then use it whenever we have a hostname. If not, don't, ever. */ |
| 412 |
if (! is_valid_ip_address (hostname)) |
| 413 |
{ |
| 414 |
if (! SSL_set_tlsext_host_name (conn, hostname)) |
| 415 |
{ |
| 416 |
DEBUGP (("Failed to set TLS server-name indication.")); |
| 417 |
goto error; |
| 418 |
} |
| 419 |
} |
| 420 |
#endif |
| 421 |
|
| 409 |
#ifndef FD_TO_SOCKET |
422 |
#ifndef FD_TO_SOCKET |
| 410 |
# define FD_TO_SOCKET(X) (X) |
423 |
# define FD_TO_SOCKET(X) (X) |
| 411 |
#endif |
424 |
#endif |