Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
ce7cb7bc
Unverified
Commit
ce7cb7bc
authored
Aug 27, 2019
by
Mark Nunberg
Committed by
GitHub
Aug 27, 2019
Browse files
Merge pull request #699 from yossigo/silent-ssl-trace
Silent SSL trace to stdout by default.
parents
9c7c694c
6d21ffce
Changes
1
Hide whitespace changes
Inline
Side-by-side
sslio.c
View file @
ce7cb7bc
...
...
@@ -8,6 +8,7 @@
void
__redisSetError
(
redisContext
*
c
,
int
type
,
const
char
*
str
);
#ifdef HIREDIS_SSL_TRACE
/**
* Callback used for debugging
*/
...
...
@@ -37,6 +38,7 @@ static void sslLogCallback(const SSL *ssl, int where, int ret) {
printf
(
"Using SSL version %s. Cipher=%s
\n
"
,
SSL_get_version
(
ssl
),
SSL_get_cipher_name
(
ssl
));
}
}
#endif
typedef
pthread_mutex_t
sslLockType
;
static
void
sslLockInit
(
sslLockType
*
l
)
{
...
...
@@ -100,7 +102,9 @@ int redisSslCreate(redisContext *c, const char *capath, const char *certpath,
redisSsl
*
s
=
c
->
ssl
;
s
->
ctx
=
SSL_CTX_new
(
SSLv23_client_method
());
#ifdef HIREDIS_SSL_TRACE
SSL_CTX_set_info_callback
(
s
->
ctx
,
sslLogCallback
);
#endif
SSL_CTX_set_mode
(
s
->
ctx
,
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
);
SSL_CTX_set_options
(
s
->
ctx
,
SSL_OP_NO_SSLv2
|
SSL_OP_NO_SSLv3
);
SSL_CTX_set_verify
(
s
->
ctx
,
SSL_VERIFY_PEER
,
NULL
);
...
...
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