Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
977779ae
Commit
977779ae
authored
Apr 19, 2017
by
Tatsuhiro Tsujikawa
Committed by
GitHub
Apr 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #896 from nghttp2/nghttpx-add-tls-sni-log-var
nghttpx: Add $tls_sni access log variable
parents
a4a2b640
a2e35a07
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
1 deletion
+17
-1
gennghttpxfun.py
gennghttpxfun.py
+1
-0
src/shrpx.cc
src/shrpx.cc
+1
-0
src/shrpx_client_handler.cc
src/shrpx_client_handler.cc
+1
-1
src/shrpx_config.cc
src/shrpx_config.cc
+5
-0
src/shrpx_log.cc
src/shrpx_log.cc
+7
-0
src/shrpx_log.h
src/shrpx_log.h
+2
-0
No files found.
gennghttpxfun.py
View file @
977779ae
...
...
@@ -188,6 +188,7 @@ LOGVARS = [
"tls_protocol"
,
"tls_session_id"
,
"tls_session_reused"
,
"tls_sni"
,
"backend_host"
,
"backend_port"
,
]
...
...
src/shrpx.cc
View file @
977779ae
...
...
@@ -2452,6 +2452,7 @@ Logging:
* $tls_session_id: session ID for SSL/TLS connection.
* $tls_session_reused: "r" if SSL/TLS session was
reused. Otherwise, "."
* $tls_sni: SNI server name for SSL/TLS connection.
* $backend_host: backend host used to fulfill the
request. "-" if backend host is not available.
* $backend_port: backend port used to fulfill the
...
...
src/shrpx_client_handler.cc
View file @
977779ae
...
...
@@ -1216,7 +1216,7 @@ void ClientHandler::write_accesslog(Downstream *downstream) {
upstream_accesslog
(
config
->
logging
.
access
.
format
,
LogSpec
{
downstream
,
ipaddr_
,
alpn_
,
downstream
,
ipaddr_
,
alpn_
,
sni_
,
nghttp2
::
tls
::
get_tls_session_info
(
&
tls_info
,
conn_
.
tls
.
ssl
),
std
::
chrono
::
high_resolution_clock
::
now
(),
// request_end_time
port_
,
faddr_
->
port
,
config
->
pid
,
...
...
src/shrpx_config.cc
View file @
977779ae
...
...
@@ -401,6 +401,11 @@ LogFragmentType log_var_lookup_token(const char *name, size_t namelen) {
break
;
case
7
:
switch
(
name
[
6
])
{
case
'i'
:
if
(
util
::
strieq_l
(
"tls_sn"
,
name
,
6
))
{
return
SHRPX_LOGF_TLS_SNI
;
}
break
;
case
't'
:
if
(
util
::
strieq_l
(
"reques"
,
name
,
6
))
{
return
SHRPX_LOGF_REQUEST
;
...
...
src/shrpx_log.cc
View file @
977779ae
...
...
@@ -518,6 +518,13 @@ void upstream_accesslog(const std::vector<LogFragment> &lfv,
std
::
tie
(
p
,
last
)
=
copy
(
lgsp
.
tls_info
->
session_reused
?
'r'
:
'.'
,
p
,
last
);
break
;
case
SHRPX_LOGF_TLS_SNI
:
if
(
lgsp
.
sni
.
empty
())
{
std
::
tie
(
p
,
last
)
=
copy
(
'-'
,
p
,
last
);
break
;
}
std
::
tie
(
p
,
last
)
=
copy_escape
(
lgsp
.
sni
,
p
,
last
);
break
;
case
SHRPX_LOGF_BACKEND_HOST
:
if
(
!
downstream_addr
)
{
std
::
tie
(
p
,
last
)
=
copy
(
'-'
,
p
,
last
);
...
...
src/shrpx_log.h
View file @
977779ae
...
...
@@ -137,6 +137,7 @@ enum LogFragmentType {
SHRPX_LOGF_SSL_SESSION_ID
=
SHRPX_LOGF_TLS_SESSION_ID
,
SHRPX_LOGF_TLS_SESSION_REUSED
,
SHRPX_LOGF_SSL_SESSION_REUSED
=
SHRPX_LOGF_TLS_SESSION_REUSED
,
SHRPX_LOGF_TLS_SNI
,
SHRPX_LOGF_BACKEND_HOST
,
SHRPX_LOGF_BACKEND_PORT
,
};
...
...
@@ -152,6 +153,7 @@ struct LogSpec {
Downstream
*
downstream
;
StringRef
remote_addr
;
StringRef
alpn
;
StringRef
sni
;
const
nghttp2
::
tls
::
TLSSessionInfo
*
tls_info
;
std
::
chrono
::
high_resolution_clock
::
time_point
request_end_time
;
StringRef
remote_port
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment