mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix GNU TLS backend under Windows.
This commit is contained in:
parent
b7814f7cf3
commit
5af14a7589
@ -1,3 +1,10 @@
|
|||||||
|
2010-06-15 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* gnutls.c [WIN32]: Include "w32sock.h".
|
||||||
|
(FD_TO_SOCKET): Add definition.
|
||||||
|
(ssl_connect_wget): Get the real socket handle by FD_TO_SOCKET.
|
||||||
|
Define FD_TO_SOCKET if it is not yet defined.
|
||||||
|
|
||||||
2010-06-14 Giuseppe Scrivano <gscrivano@gnu.org>
|
2010-06-14 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
* gnutls.c: Include <stdlib.h>.
|
* gnutls.c: Include <stdlib.h>.
|
||||||
|
@ -47,6 +47,10 @@ as that of the covered work. */
|
|||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
# include "w32sock.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Note: some of the functions private to this file have names that
|
/* Note: some of the functions private to this file have names that
|
||||||
begin with "wgnutls_" (e.g. wgnutls_read) so that they wouldn't be
|
begin with "wgnutls_" (e.g. wgnutls_read) so that they wouldn't be
|
||||||
confused with actual gnutls functions -- such as the gnutls_read
|
confused with actual gnutls functions -- such as the gnutls_read
|
||||||
@ -196,7 +200,10 @@ ssl_connect_wget (int fd)
|
|||||||
gnutls_set_default_priority (session);
|
gnutls_set_default_priority (session);
|
||||||
gnutls_certificate_type_set_priority (session, cert_type_priority);
|
gnutls_certificate_type_set_priority (session, cert_type_priority);
|
||||||
gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, credentials);
|
gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, credentials);
|
||||||
gnutls_transport_set_ptr (session, (gnutls_transport_ptr) fd);
|
#ifndef FD_TO_SOCKET
|
||||||
|
# define FD_TO_SOCKET(X) (X)
|
||||||
|
#endif
|
||||||
|
gnutls_transport_set_ptr (session, (gnutls_transport_ptr) FD_TO_SOCKET (fd));
|
||||||
err = gnutls_handshake (session);
|
err = gnutls_handshake (session);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ ssl_connect_wget (int fd)
|
|||||||
if (!conn)
|
if (!conn)
|
||||||
goto error;
|
goto error;
|
||||||
#ifndef FD_TO_SOCKET
|
#ifndef FD_TO_SOCKET
|
||||||
# define FD_TO_SOCKET(x) (x)
|
# define FD_TO_SOCKET(X) (X)
|
||||||
#endif
|
#endif
|
||||||
if (!SSL_set_fd (conn, FD_TO_SOCKET (fd)))
|
if (!SSL_set_fd (conn, FD_TO_SOCKET (fd)))
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user