Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2fb74678
Commit
2fb74678
authored
Sep 07, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use a process global SSL context instead of per connection.
parent
520b6e81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
net.c
dlls/winhttp/net.c
+7
-9
winhttp_private.h
dlls/winhttp/winhttp_private.h
+0
-1
No files found.
dlls/winhttp/net.c
View file @
2fb74678
...
...
@@ -83,6 +83,7 @@ static void *libssl_handle;
static
void
*
libcrypto_handle
;
static
SSL_METHOD
*
method
;
static
SSL_CTX
*
ctx
;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
...
...
@@ -90,7 +91,6 @@ MAKE_FUNCPTR( SSL_library_init );
MAKE_FUNCPTR
(
SSL_load_error_strings
);
MAKE_FUNCPTR
(
SSLv23_method
);
MAKE_FUNCPTR
(
SSL_CTX_new
);
MAKE_FUNCPTR
(
SSL_CTX_free
);
MAKE_FUNCPTR
(
SSL_new
);
MAKE_FUNCPTR
(
SSL_free
);
MAKE_FUNCPTR
(
SSL_set_fd
);
...
...
@@ -207,7 +207,6 @@ BOOL netconn_init( netconn_t *conn, BOOL secure )
LOAD_FUNCPTR
(
SSL_load_error_strings
);
LOAD_FUNCPTR
(
SSLv23_method
);
LOAD_FUNCPTR
(
SSL_CTX_new
);
LOAD_FUNCPTR
(
SSL_CTX_free
);
LOAD_FUNCPTR
(
SSL_new
);
LOAD_FUNCPTR
(
SSL_free
);
LOAD_FUNCPTR
(
SSL_set_fd
);
...
...
@@ -240,8 +239,6 @@ BOOL netconn_init( netconn_t *conn, BOOL secure )
pBIO_new_fp
(
stderr
,
BIO_NOCLOSE
);
method
=
pSSLv23_method
();
conn
->
ssl_ctx
=
pSSL_CTX_new
(
method
);
#else
WARN
(
"SSL support not compiled in.
\n
"
);
set_last_error
(
ERROR_WINHTTP_SECURE_CHANNEL_ERROR
);
...
...
@@ -312,13 +309,14 @@ BOOL netconn_secure_connect( netconn_t *conn )
X509
*
cert
;
long
res
;
if
(
!
pSSL_CTX_set_default_verify_paths
(
conn
->
ssl_ctx
))
ctx
=
pSSL_CTX_new
(
method
);
if
(
!
pSSL_CTX_set_default_verify_paths
(
ctx
))
{
ERR
(
"SSL_CTX_set_default_verify_paths failed: %s
\n
"
,
pERR_error_string
(
pERR_get_error
(),
0
));
set_last_error
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
!
(
conn
->
ssl_conn
=
pSSL_new
(
c
onn
->
ssl_c
tx
)))
if
(
!
(
conn
->
ssl_conn
=
pSSL_new
(
ctx
)))
{
ERR
(
"SSL_new failed: %s
\n
"
,
pERR_error_string
(
pERR_get_error
(),
0
));
set_last_error
(
ERROR_OUTOFMEMORY
);
...
...
@@ -488,8 +486,8 @@ BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
#ifdef SONAME_LIBSSL
long
timeout
;
timeout
=
pSSL_CTX_get_timeout
(
c
onn
->
ssl_c
tx
);
pSSL_CTX_set_timeout
(
c
onn
->
ssl_c
tx
,
DEFAULT_RECEIVE_TIMEOUT
);
timeout
=
pSSL_CTX_get_timeout
(
ctx
);
pSSL_CTX_set_timeout
(
ctx
,
DEFAULT_RECEIVE_TIMEOUT
);
while
(
recvd
<
*
buflen
)
{
...
...
@@ -506,7 +504,7 @@ BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
}
if
(
buffer
[
recvd
]
!=
'\r'
)
recvd
++
;
}
pSSL_CTX_set_timeout
(
c
onn
->
ssl_c
tx
,
timeout
);
pSSL_CTX_set_timeout
(
ctx
,
timeout
);
if
(
ret
)
{
buffer
[
recvd
++
]
=
0
;
...
...
dlls/winhttp/winhttp_private.h
View file @
2fb74678
...
...
@@ -91,7 +91,6 @@ typedef struct
{
int
socket
;
BOOL
secure
;
/* SSL active on connection? */
void
*
ssl_ctx
;
void
*
ssl_conn
;
char
*
peek_msg
;
char
*
peek_msg_mem
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment