TLS now working again.

This commit is contained in:
Michael Brown
2007-07-30 02:48:38 +01:00
parent 9a9f46ff58
commit 6fc9ed167e
3 changed files with 1904 additions and 14 deletions

View File

@@ -468,6 +468,7 @@ static struct xfer_interface_operations http_xfer_operations = {
static int http_open ( struct xfer_interface *xfer, struct uri *uri ) {
struct http_request *http;
struct sockaddr_tcpip server;
struct xfer_interface *socket;
int rc;
/* Sanity checks */
@@ -487,19 +488,17 @@ static int http_open ( struct xfer_interface *xfer, struct uri *uri ) {
/* Open socket */
memset ( &server, 0, sizeof ( server ) );
server.st_port = htons ( uri_port ( http->uri, HTTP_PORT ) );
if ( ( rc = xfer_open_named_socket ( &http->socket, SOCK_STREAM,
socket = &http->socket;
if ( strcmp ( http->uri->scheme, "https" ) == 0 ) {
server.st_port = htons ( uri_port ( http->uri, HTTPS_PORT ) );
if ( ( rc = add_tls ( socket, &socket ) ) != 0 )
goto err;
}
if ( ( rc = xfer_open_named_socket ( socket, SOCK_STREAM,
( struct sockaddr * ) &server,
uri->host, NULL ) ) != 0 )
goto err;
#if 0
if ( strcmp ( http->uri->scheme, "https" ) == 0 ) {
st->st_port = htons ( uri_port ( http->uri, HTTPS_PORT ) );
if ( ( rc = add_tls ( &http->stream ) ) != 0 )
goto err;
}
#endif
/* Attach to parent interface, mortalise self, and return */
xfer_plug_plug ( &http->xfer, xfer );
ref_put ( &http->refcnt );

1732
src/net/tls.c Normal file

File diff suppressed because it is too large Load Diff