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
2c7ed01f
Commit
2c7ed01f
authored
Jan 17, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use std::string for Downstream::backend_tls_sni_name
parent
34d5382d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
src/shrpx_config.cc
src/shrpx_config.cc
+1
-1
src/shrpx_config.h
src/shrpx_config.h
+1
-1
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+2
-2
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+5
-4
No files found.
src/shrpx_config.cc
View file @
2c7ed01f
...
...
@@ -1599,7 +1599,7 @@ int parse_config(const char *opt, const char *optarg,
return
0
;
case
SHRPX_OPTID_BACKEND_TLS_SNI_FIELD
:
mod_config
()
->
backend_tls_sni_name
=
strcopy
(
optarg
)
;
mod_config
()
->
backend_tls_sni_name
=
optarg
;
return
0
;
case
SHRPX_OPTID_PID_FILE
:
...
...
src/shrpx_config.h
View file @
2c7ed01f
...
...
@@ -310,6 +310,7 @@ struct Config {
// field. This is only used when user defined static obfuscated
// string is provided.
std
::
string
forwarded_for_obfuscated
;
std
::
string
backend_tls_sni_name
;
std
::
chrono
::
seconds
tls_session_timeout
;
ev_tstamp
http2_upstream_read_timeout
;
ev_tstamp
upstream_read_timeout
;
...
...
@@ -329,7 +330,6 @@ struct Config {
std
::
unique_ptr
<
char
[]
>
private_key_passwd
;
std
::
unique_ptr
<
char
[]
>
cert_file
;
std
::
unique_ptr
<
char
[]
>
dh_param_file
;
std
::
unique_ptr
<
char
[]
>
backend_tls_sni_name
;
std
::
unique_ptr
<
char
[]
>
pid_file
;
std
::
unique_ptr
<
char
[]
>
conf_path
;
std
::
unique_ptr
<
char
[]
>
ciphers
;
...
...
src/shrpx_http2_session.cc
View file @
2c7ed01f
...
...
@@ -335,8 +335,8 @@ int Http2Session::initiate_connection() {
}
const
char
*
sni_name
=
nullptr
;
if
(
get_config
()
->
backend_tls_sni_name
)
{
sni_name
=
get_config
()
->
backend_tls_sni_name
.
get
();
if
(
!
get_config
()
->
backend_tls_sni_name
.
empty
()
)
{
sni_name
=
get_config
()
->
backend_tls_sni_name
.
c_str
();
}
else
{
sni_name
=
downstream_addr
.
host
.
c_str
();
}
...
...
src/shrpx_ssl.cc
View file @
2c7ed01f
...
...
@@ -971,10 +971,11 @@ int check_cert(SSL *ssl, const DownstreamAddr *addr) {
<<
X509_verify_cert_error_string
(
verify_res
);
return
-
1
;
}
auto
hostname
=
get_config
()
->
backend_tls_sni_name
?
get_config
()
->
backend_tls_sni_name
.
get
()
:
addr
->
host
.
c_str
();
if
(
verify_hostname
(
cert
,
hostname
,
strlen
(
hostname
),
&
addr
->
addr
)
!=
0
)
{
auto
hostname
=
!
get_config
()
->
backend_tls_sni_name
.
empty
()
?
StringAdaptor
(
get_config
()
->
backend_tls_sni_name
)
:
StringAdaptor
(
addr
->
host
);
if
(
verify_hostname
(
cert
,
hostname
.
c_str
(),
hostname
.
size
(),
&
addr
->
addr
)
!=
0
)
{
LOG
(
ERROR
)
<<
"Certificate verification failed: hostname does not match"
;
return
-
1
;
}
...
...
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