Skip to content

Commit

Permalink
Merge pull request #1084 from stanhu/sh-improve-ssl-docs
Browse files Browse the repository at this point in the history
Improve example for SSL initialization in README.md
  • Loading branch information
michael-grunder authored Aug 10, 2022
2 parents 0865c11 + c711161 commit dd7979a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ redisSSLContext *ssl_context;
/* An error variable to indicate what went wrong, if the context fails to
* initialize.
*/
redisSSLContextError ssl_error;
redisSSLContextError ssl_error = REDIS_SSL_CTX_NONE;

/* Initialize global OpenSSL state.
*
Expand All @@ -622,11 +622,11 @@ ssl_context = redisCreateSSLContext(
"redis.mydomain.com", /* Server name to request (SNI), optional */
&ssl_error);

if(ssl_context == NULL || ssl_error != 0) {
if(ssl_context == NULL || ssl_error != REDIS_SSL_CTX_NONE) {
/* Handle error and abort... */
/* e.g.
printf("SSL error: %s\n",
(ssl_error != 0) ?
(ssl_error != REDIS_SSL_CTX_NONE) ?
redisSSLContextGetError(ssl_error) : "Unknown error");
// Abort
*/
Expand Down

0 comments on commit dd7979a

Please sign in to comment.