mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
sample/le-proxy: use TLS_method instead of SSLv23_method (latest deprecated)
This commit is contained in:
parent
532a47ce1e
commit
fa58cb1da0
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
|
||||||
static BIO_METHOD *BIO_meth_new(int type, const char *name)
|
static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
|
||||||
{
|
{
|
||||||
BIO_METHOD *biom = calloc(1, sizeof(BIO_METHOD));
|
BIO_METHOD *biom = calloc(1, sizeof(BIO_METHOD));
|
||||||
|
|
||||||
@ -28,6 +28,8 @@ static BIO_METHOD *BIO_meth_new(int type, const char *name)
|
|||||||
#define BIO_get_data(b) (b)->ptr
|
#define BIO_get_data(b) (b)->ptr
|
||||||
#define BIO_get_shutdown(b) (b)->shutdown
|
#define BIO_get_shutdown(b) (b)->shutdown
|
||||||
|
|
||||||
|
#define TLS_method SSLv23_method
|
||||||
|
|
||||||
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
||||||
|
|
||||||
#endif /* OPENSSL_COMPAT_H */
|
#endif /* OPENSSL_COMPAT_H */
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#include "openssl-compat.h"
|
||||||
|
|
||||||
static struct event_base *base;
|
static struct event_base *base;
|
||||||
static struct sockaddr_storage listen_on_addr;
|
static struct sockaddr_storage listen_on_addr;
|
||||||
@ -269,7 +270,7 @@ main(int argc, char **argv)
|
|||||||
fprintf(stderr, "RAND_poll() failed.\n");
|
fprintf(stderr, "RAND_poll() failed.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ssl_ctx = SSL_CTX_new(SSLv23_method());
|
ssl_ctx = SSL_CTX_new(TLS_method());
|
||||||
}
|
}
|
||||||
|
|
||||||
listener = evconnlistener_new_bind(base, accept_cb, NULL,
|
listener = evconnlistener_new_bind(base, accept_cb, NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user