From 0ea041e8cb3567f6f33fec064c5a704056d39457 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 12 Jan 2015 22:47:30 +0900 Subject: [PATCH] nghttpx: Add doc and clean up --- src/shrpx_ssl.cc | 6 ++---- src/shrpx_ssl.h | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index 06ecf7ef..da0c300a 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -288,8 +288,7 @@ long int create_tls_proto_mask(const std::vector &tls_proto_list) { SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file) { - SSL_CTX *ssl_ctx; - ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + auto ssl_ctx = SSL_CTX_new(SSLv23_server_method()); if (!ssl_ctx) { LOG(FATAL) << ERR_error_string(ERR_get_error(), nullptr); DIE(); @@ -440,8 +439,7 @@ int select_next_proto_cb(SSL *ssl, unsigned char **out, unsigned char *outlen, } // namespace SSL_CTX *create_ssl_client_context() { - SSL_CTX *ssl_ctx; - ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + auto ssl_ctx = SSL_CTX_new(SSLv23_client_method()); if (!ssl_ctx) { LOG(FATAL) << ERR_error_string(ERR_get_error(), nullptr); DIE(); diff --git a/src/shrpx_ssl.h b/src/shrpx_ssl.h index 813f91c6..148df3e1 100644 --- a/src/shrpx_ssl.h +++ b/src/shrpx_ssl.h @@ -42,9 +42,11 @@ class DownstreamConnectionPool; namespace ssl { +// Create server side SSL_CTX SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file); +// Create client side SSL_CTX SSL_CTX *create_ssl_client_context(); ClientHandler *accept_connection(struct ev_loop *loop, SSL_CTX *ssl_ctx, int fd,