From 248a64f0b2ca89cbe4efaaa5c90adbb1d31766f7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 11 Dec 2015 23:14:52 +0900 Subject: [PATCH] Compile with OpenSSL 1.1.0-pre1 --- src/HttpServer.cc | 1 + src/shrpx_ssl.cc | 1 + src/ssl.cc | 13 +++++-------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 14cb0395..c331d12c 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -53,6 +53,7 @@ #include #include +#include #include diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index 0a7ca6ac..61e61cbf 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -41,6 +41,7 @@ #include #include #include +#include #include diff --git a/src/ssl.cc b/src/ssl.cc index bfb531f8..d5bb3562 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -80,12 +80,7 @@ LibsslGlobalLock::LibsslGlobalLock() { LibsslGlobalLock::~LibsslGlobalLock() { ssl_global_locks.clear(); } const char *get_tls_protocol(SSL *ssl) { - auto session = SSL_get_session(ssl); - if (!session) { - return "unknown"; - } - - switch (session->ssl_version) { + switch (SSL_version(ssl)) { case SSL2_VERSION: return "SSLv2"; case SSL3_VERSION: @@ -113,10 +108,12 @@ TLSSessionInfo *get_tls_session_info(TLSSessionInfo *tls_info, SSL *ssl) { tls_info->cipher = SSL_get_cipher_name(ssl); tls_info->protocol = get_tls_protocol(ssl); - tls_info->session_id = session->session_id; - tls_info->session_id_length = session->session_id_length; tls_info->session_reused = SSL_session_reused(ssl); + unsigned int session_id_length; + tls_info->session_id = SSL_SESSION_get_id(session, &session_id_length); + tls_info->session_id_length = session_id_length; + return tls_info; }