Disable SSL by default
This commit is contained in:
parent
08efa46599
commit
82549a53de
4
Makefile
4
Makefile
@ -54,9 +54,11 @@ DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(L
|
||||
STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
|
||||
STLIB_MAKE_CMD=$(AR) rcs $(STLIBNAME)
|
||||
|
||||
ifdef USE_SSL
|
||||
OPENSSL_PREFIX=/usr/local/opt/openssl
|
||||
CFLAGS+=-I$(OPENSSL_PREFIX)/include
|
||||
CFLAGS+=-I$(OPENSSL_PREFIX)/include -DHIREDIS_SSL
|
||||
LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto
|
||||
endif
|
||||
|
||||
# Platform-specific overrides
|
||||
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
||||
|
2
sslio.c
2
sslio.c
@ -2,7 +2,7 @@
|
||||
#include "sslio.h"
|
||||
|
||||
#include <assert.h>
|
||||
#ifndef HIREDIS_NOSSL
|
||||
#ifdef HIREDIS_SSL
|
||||
#include <pthread.h>
|
||||
|
||||
void __redisSetError(redisContext *c, int type, const char *str);
|
||||
|
21
sslio.h
21
sslio.h
@ -2,19 +2,26 @@
|
||||
#define REDIS_SSLIO_H
|
||||
|
||||
|
||||
#ifdef HIREDIS_NOSSL
|
||||
#ifndef HIREDIS_SSL
|
||||
typedef struct redisSsl {
|
||||
int dummy;
|
||||
size_t lastLen;
|
||||
int wantRead;
|
||||
int pendingWrite;
|
||||
} redisSsl;
|
||||
static void redisFreeSsl(redisSsl *) {
|
||||
static inline void redisFreeSsl(redisSsl *ssl) {
|
||||
(void)ssl;
|
||||
}
|
||||
static int redisSslCreate(struct redisContext *c) {
|
||||
static inline int redisSslCreate(struct redisContext *c, const char *ca,
|
||||
const char *cert, const char *key) {
|
||||
(void)c;(void)ca;(void)cert;(void)key;
|
||||
return REDIS_ERR;
|
||||
}
|
||||
static int redisSslRead(struct redisContect *c, char *s, size_t, n) {
|
||||
static inline int redisSslRead(struct redisContext *c, char *s, size_t n) {
|
||||
(void)c;(void)s;(void)n;
|
||||
return -1;
|
||||
}
|
||||
static int redisSslWrite(struct redisContext *c) {
|
||||
static inline int redisSslWrite(struct redisContext *c) {
|
||||
(void)c;
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
@ -53,5 +60,5 @@ int redisSslCreate(struct redisContext *c, const char *caPath,
|
||||
int redisSslRead(struct redisContext *c, char *buf, size_t bufcap);
|
||||
int redisSslWrite(struct redisContext *c);
|
||||
|
||||
#endif /* !HIREDIS_NOSSL */
|
||||
#endif /* HIREDIS_SSL */
|
||||
#endif /* HIREDIS_SSLIO_H */
|
||||
|
Loading…
Reference in New Issue
Block a user