Code

SSL utils: Added init() and shutdown() functions for global setup/shutdown.
[sysdb.git] / src / tools / sysdb / main.c
index e9e2202635d1d89dcb238a6e6c18dd7b295695cb..c58c735675106da0ebc33afd94680cc7478dfc89 100644 (file)
@@ -38,6 +38,7 @@
 #include "utils/llist.h"
 #include "utils/strbuf.h"
 #include "utils/os.h"
+#include "utils/ssl.h"
 
 #include <errno.h>
 
@@ -77,9 +78,6 @@
 #      endif
 #endif /* READLINEs */
 
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-
 #ifndef DEFAULT_SOCKET
 #      define DEFAULT_SOCKET "unix:"LOCALSTATEDIR"/run/sysdbd.sock"
 #endif
@@ -299,8 +297,7 @@ main(int argc, char **argv)
        if (! input.user)
                exit(1);
 
-       SSL_load_error_strings();
-       OpenSSL_add_ssl_algorithms();
+       sdb_ssl_init();
 
        input.client = sdb_client_create(host);
        if (! input.client) {
@@ -372,8 +369,7 @@ main(int argc, char **argv)
        }
 
        sdb_input_reset(&input);
-
-       ERR_free_strings();
+       sdb_ssl_shutdown();
        return 0;
 } /* main */