[tls] Add support for Server Name Indication (SNI)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-03-03 20:15:21 +00:00
parent d9ce3bfe4c
commit b7f8d1bbfd
4 changed files with 39 additions and 5 deletions

View File

@@ -838,6 +838,7 @@ static struct process_descriptor http_process_desc =
int http_open_filter ( struct interface *xfer, struct uri *uri,
unsigned int default_port,
int ( * filter ) ( struct interface *xfer,
const char *name,
struct interface **next ) ) {
struct http_request *http;
struct sockaddr_tcpip server;
@@ -865,7 +866,7 @@ int http_open_filter ( struct interface *xfer, struct uri *uri,
server.st_port = htons ( uri_port ( http->uri, default_port ) );
socket = &http->socket;
if ( filter ) {
if ( ( rc = filter ( socket, &socket ) ) != 0 )
if ( ( rc = filter ( socket, uri->host, &socket ) ) != 0 )
goto err;
}
if ( ( rc = xfer_open_named_socket ( socket, SOCK_STREAM,