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
c999987b
Commit
c999987b
authored
Feb 14, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use ImmutableString for private_key_file
parent
529a59d3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
src/shrpx.cc
src/shrpx.cc
+1
-1
src/shrpx_config.cc
src/shrpx_config.cc
+2
-2
src/shrpx_config.h
src/shrpx_config.h
+2
-2
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+2
-3
No files found.
src/shrpx.cc
View file @
c999987b
...
@@ -2085,7 +2085,7 @@ void process_options(
...
@@ -2085,7 +2085,7 @@ void process_options(
}
}
if
(
!
upstreamconf
.
no_tls
&&
if
(
!
upstreamconf
.
no_tls
&&
(
!
tlsconf
.
private_key_file
||
!
tlsconf
.
cert_file
))
{
(
tlsconf
.
private_key_file
.
empty
()
||
!
tlsconf
.
cert_file
))
{
print_usage
(
std
::
cerr
);
print_usage
(
std
::
cerr
);
LOG
(
FATAL
)
<<
"Too few arguments"
;
LOG
(
FATAL
)
<<
"Too few arguments"
;
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
src/shrpx_config.cc
View file @
c999987b
...
@@ -1745,7 +1745,7 @@ int parse_config(const char *opt, const char *optarg,
...
@@ -1745,7 +1745,7 @@ int parse_config(const char *opt, const char *optarg,
return
0
;
return
0
;
}
}
case
SHRPX_OPTID_PRIVATE_KEY_FILE
:
case
SHRPX_OPTID_PRIVATE_KEY_FILE
:
mod_config
()
->
tls
.
private_key_file
=
strcopy
(
optarg
)
;
mod_config
()
->
tls
.
private_key_file
=
optarg
;
return
0
;
return
0
;
case
SHRPX_OPTID_PRIVATE_KEY_PASSWD_FILE
:
{
case
SHRPX_OPTID_PRIVATE_KEY_PASSWD_FILE
:
{
...
@@ -1911,7 +1911,7 @@ int parse_config(const char *opt, const char *optarg,
...
@@ -1911,7 +1911,7 @@ int parse_config(const char *opt, const char *optarg,
return
0
;
return
0
;
case
SHRPX_OPTID_CLIENT_PRIVATE_KEY_FILE
:
case
SHRPX_OPTID_CLIENT_PRIVATE_KEY_FILE
:
mod_config
()
->
tls
.
client
.
private_key_file
=
strcopy
(
optarg
)
;
mod_config
()
->
tls
.
client
.
private_key_file
=
optarg
;
return
0
;
return
0
;
case
SHRPX_OPTID_CLIENT_CERT_FILE
:
case
SHRPX_OPTID_CLIENT_CERT_FILE
:
...
...
src/shrpx_config.h
View file @
c999987b
...
@@ -408,7 +408,7 @@ struct TLSConfig {
...
@@ -408,7 +408,7 @@ struct TLSConfig {
// Client private key and certificate used in backend connections.
// Client private key and certificate used in backend connections.
struct
{
struct
{
std
::
unique_ptr
<
char
[]
>
private_key_file
;
ImmutableString
private_key_file
;
std
::
unique_ptr
<
char
[]
>
cert_file
;
std
::
unique_ptr
<
char
[]
>
cert_file
;
}
client
;
}
client
;
...
@@ -426,7 +426,7 @@ struct TLSConfig {
...
@@ -426,7 +426,7 @@ struct TLSConfig {
long
int
tls_proto_mask
;
long
int
tls_proto_mask
;
std
::
string
backend_sni_name
;
std
::
string
backend_sni_name
;
std
::
chrono
::
seconds
session_timeout
;
std
::
chrono
::
seconds
session_timeout
;
std
::
unique_ptr
<
char
[]
>
private_key_file
;
ImmutableString
private_key_file
;
std
::
unique_ptr
<
char
[]
>
private_key_passwd
;
std
::
unique_ptr
<
char
[]
>
private_key_passwd
;
std
::
unique_ptr
<
char
[]
>
cert_file
;
std
::
unique_ptr
<
char
[]
>
cert_file
;
std
::
unique_ptr
<
char
[]
>
dh_param_file
;
std
::
unique_ptr
<
char
[]
>
dh_param_file
;
...
...
src/shrpx_ssl.cc
View file @
c999987b
...
@@ -1245,7 +1245,7 @@ SSL_CTX *setup_server_ssl_context(std::vector<SSL_CTX *> &all_ssl_ctx,
...
@@ -1245,7 +1245,7 @@ SSL_CTX *setup_server_ssl_context(std::vector<SSL_CTX *> &all_ssl_ctx,
auto
&
tlsconf
=
get_config
()
->
tls
;
auto
&
tlsconf
=
get_config
()
->
tls
;
auto
ssl_ctx
=
ssl
::
create_ssl_context
(
tlsconf
.
private_key_file
.
get
(),
auto
ssl_ctx
=
ssl
::
create_ssl_context
(
tlsconf
.
private_key_file
.
c_str
(),
tlsconf
.
cert_file
.
get
()
tlsconf
.
cert_file
.
get
()
#ifdef HAVE_NEVERBLEED
#ifdef HAVE_NEVERBLEED
,
,
...
@@ -1325,8 +1325,7 @@ SSL_CTX *setup_downstream_client_ssl_context(
...
@@ -1325,8 +1325,7 @@ SSL_CTX *setup_downstream_client_ssl_context(
#endif // HAVE_NEVERBLEED
#endif // HAVE_NEVERBLEED
StringRef
{
tlsconf
.
cacert
},
StringRef
{
tlsconf
.
cacert
},
StringRef
::
from_maybe_nullptr
(
tlsconf
.
client
.
cert_file
.
get
()),
StringRef
::
from_maybe_nullptr
(
tlsconf
.
client
.
cert_file
.
get
()),
StringRef
::
from_maybe_nullptr
(
tlsconf
.
client
.
private_key_file
.
get
()),
StringRef
{
tlsconf
.
client
.
private_key_file
},
alpn
,
next_proto_select_cb
);
alpn
,
next_proto_select_cb
);
}
}
CertLookupTree
*
create_cert_lookup_tree
()
{
CertLookupTree
*
create_cert_lookup_tree
()
{
...
...
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