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
dd7979ac
Unverified
Commit
dd7979ac
authored
Aug 10, 2022
by
Michael Grunder
Committed by
GitHub
Aug 10, 2022
Browse files
Merge pull request #1084 from stanhu/sh-improve-ssl-docs
Improve example for SSL initialization in README.md
parents
0865c115
c7111617
Changes
1
Show whitespace changes
Inline
Side-by-side
README.md
View file @
dd7979ac
...
@@ -604,7 +604,7 @@ redisSSLContext *ssl_context;
...
@@ -604,7 +604,7 @@ redisSSLContext *ssl_context;
/* An error variable to indicate what went wrong, if the context fails to
/* An error variable to indicate what went wrong, if the context fails to
* initialize.
* initialize.
*/
*/
redisSSLContextError
ssl_error
;
redisSSLContextError
ssl_error
=
REDIS_SSL_CTX_NONE
;
/* Initialize global OpenSSL state.
/* Initialize global OpenSSL state.
*
*
...
@@ -622,11 +622,11 @@ ssl_context = redisCreateSSLContext(
...
@@ -622,11 +622,11 @@ ssl_context = redisCreateSSLContext(
"redis.mydomain.com"
,
/* Server name to request (SNI), optional */
"redis.mydomain.com"
,
/* Server name to request (SNI), optional */
&
ssl_error
);
&
ssl_error
);
if
(
ssl_context
==
NULL
||
ssl_error
!=
0
)
{
if
(
ssl_context
==
NULL
||
ssl_error
!=
REDIS_SSL_CTX_NONE
)
{
/* Handle error and abort... */
/* Handle error and abort... */
/* e.g.
/* e.g.
printf("SSL error: %s\n",
printf("SSL error: %s\n",
(ssl_error !=
0
) ?
(ssl_error !=
REDIS_SSL_CTX_NONE
) ?
redisSSLContextGetError(ssl_error) : "Unknown error");
redisSSLContextGetError(ssl_error) : "Unknown error");
// Abort
// Abort
*/
*/
...
...
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