zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roodkcab <...@git.apache.org>
Subject [GitHub] zookeeper pull request #639: ZOOKEEPER-2122: add openssl to zookeeper c clie...
Date Tue, 25 Sep 2018 12:21:15 GMT
Github user roodkcab commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/639#discussion_r220168781
  
    --- Diff: zookeeper-client/zookeeper-client-c/src/zookeeper.c ---
    @@ -2213,6 +2259,72 @@ static socket_t zookeeper_connect(zhandle_t *zh,
         LOG_DEBUG(LOGCALLBACK(zh), "[zk] connect()\n");
         rc = connect(fd, (struct sockaddr *)addr, addr_len);
     
    +#ifdef HAVE_OPENSSL_H
    +    if (zh->fd->cert != NULL) {
    +        SSL_CTX *ctx = NULL;
    +        SSL *ssl = NULL;
    +        const SSL_METHOD *method;
    +
    +        SSL_library_init();
    --- End diff --
    
    I think it's better to use OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS,
NULL), SSL_library_init is for pre-1.1.0, I'll have a unit test for this and push again. Thanks!


---

Mime
View raw message