--- src/event/ngx_event_openssl.c.orig	2014-09-30 15:20:34.000000000 +0200
+++ src/event/ngx_event_openssl.c	2015-01-08 13:37:34.075314661 +0100
@@ -3030,6 +3030,18 @@
 
 
 ngx_int_t
+ngx_ssl_get_cipher_bits(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
+{
+    s->data = ngx_pnalloc(pool, NGX_INT_T_LEN);
+    if (s->data == NULL) {
+        return NGX_ERROR;
+    }
+    s->len = ngx_sprintf(s->data, "%ui", SSL_get_cipher_bits(c->ssl->connection, NULL)) - s->data;
+    return NGX_OK;
+}
+
+
+ngx_int_t
 ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
 {
     u_char        *buf;
--- src/event/ngx_event_openssl.h.orig	2014-09-30 15:20:34.000000000 +0200
+++ src/event/ngx_event_openssl.h	2015-01-08 09:27:32.927464848 +0100
@@ -169,6 +169,8 @@
     ngx_str_t *s);
 ngx_int_t ngx_ssl_get_cipher_name(ngx_connection_t *c, ngx_pool_t *pool,
     ngx_str_t *s);
+ngx_int_t ngx_ssl_get_cipher_bits(ngx_connection_t *c, ngx_pool_t *pool,
+    ngx_str_t *s);
 ngx_int_t ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool,
     ngx_str_t *s);
 ngx_int_t ngx_ssl_get_session_reused(ngx_connection_t *c, ngx_pool_t *pool,
--- src/http/modules/ngx_http_ssl_module.c.orig	2015-01-08 09:24:55.329753673 +0100
+++ src/http/modules/ngx_http_ssl_module.c	2015-01-08 13:40:02.944065659 +0100
@@ -276,6 +276,9 @@
     { ngx_string("ssl_cipher"), NULL, ngx_http_ssl_static_variable,
       (uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGEABLE, 0 },
 
+    { ngx_string("ssl_cipher_bits"), NULL, ngx_http_ssl_variable,
+      (uintptr_t) ngx_ssl_get_cipher_bits, NGX_HTTP_VAR_CHANGEABLE, 0 },
+
     { ngx_string("ssl_session_id"), NULL, ngx_http_ssl_variable,
       (uintptr_t) ngx_ssl_get_session_id, NGX_HTTP_VAR_CHANGEABLE, 0 },
 
