Commit 0b19e855 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Add support for secure connections.

parent 02ca43cb
......@@ -683,6 +683,12 @@ static BOOL open_connection( request_t *request )
heap_free( addressW );
return FALSE;
}
if (request->hdr.flags & WINHTTP_FLAG_SECURE && !netconn_secure_connect( &request->netconn ))
{
netconn_close( &request->netconn );
heap_free( addressW );
return FALSE;
}
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, addressW, 0 );
......
......@@ -270,7 +270,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
request->connect = connect;
list_add_head( &connect->hdr.children, &request->hdr.entry );
if (!netconn_init( &request->netconn )) goto end;
if (!netconn_init( &request->netconn, request->hdr.flags & WINHTTP_FLAG_SECURE )) goto end;
if (!verb) verb = get;
if (!object) object = slash;
......
......@@ -87,6 +87,9 @@ typedef struct
typedef struct
{
int socket;
BOOL secure; /* SSL active on connection? */
void *ssl_ctx;
void *ssl_conn;
char *peek_msg;
char *peek_msg_mem;
size_t peek_len;
......@@ -130,10 +133,11 @@ BOOL netconn_connect( netconn_t *, const struct sockaddr *, unsigned int );
BOOL netconn_connected( netconn_t * );
BOOL netconn_create( netconn_t *, int, int, int );
BOOL netconn_get_next_line( netconn_t *, char *, DWORD * );
BOOL netconn_init( netconn_t * );
BOOL netconn_init( netconn_t *, BOOL );
BOOL netconn_query_data_available( netconn_t *, DWORD * );
BOOL netconn_recv( netconn_t *, void *, size_t, int, int * );
BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr_in * );
BOOL netconn_secure_connect( netconn_t * );
BOOL netconn_send( netconn_t *, const void *, size_t, int, int * );
static inline void *heap_alloc( SIZE_T size )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment