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
36dfc0a5
Commit
36dfc0a5
authored
Jan 08, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Reorganize client side TLS configuration
parent
55bf6cdb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
src/shrpx_config.cc
src/shrpx_config.cc
+3
-3
src/shrpx_config.h
src/shrpx_config.h
+7
-8
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+2
-2
No files found.
src/shrpx_config.cc
View file @
36dfc0a5
...
...
@@ -1265,7 +1265,7 @@ int parse_psk_secrets(Config *config, const StringRef &path) {
namespace
{
// Reads PSK secrets from path, and parses each line. The result is
// directly stored into config->tls.client
_
psk. This function returns
// directly stored into config->tls.client
.
psk. This function returns
// 0 if it succeeds, or -1.
int
parse_client_psk_secrets
(
Config
*
config
,
const
StringRef
&
path
)
{
auto
&
tlsconf
=
config
->
tls
;
...
...
@@ -1310,10 +1310,10 @@ int parse_client_psk_secrets(Config *config, const StringRef &path) {
return
-
1
;
}
tlsconf
.
client
_
psk
.
identity
=
tlsconf
.
client
.
psk
.
identity
=
make_string_ref
(
config
->
balloc
,
StringRef
{
std
::
begin
(
line
),
sep_it
});
tlsconf
.
client
_
psk
.
secret
=
tlsconf
.
client
.
psk
.
secret
=
util
::
decode_hex
(
config
->
balloc
,
StringRef
{
sep_it
+
1
,
std
::
end
(
line
)});
return
0
;
...
...
src/shrpx_config.h
View file @
36dfc0a5
...
...
@@ -546,19 +546,18 @@ struct TLSConfig {
bool
enabled
;
}
client_verify
;
// Client
private key and certificate used in backend connections
.
// Client
(backend connection) TLS configuration
.
struct
{
// Client PSK configuration
struct
{
// identity must be NULL terminated string.
StringRef
identity
;
StringRef
secret
;
}
psk
;
StringRef
private_key_file
;
StringRef
cert_file
;
}
client
;
// Client PSK configuration
struct
{
// identity must be NULL terminated string.
StringRef
identity
;
StringRef
secret
;
}
client_psk
;
// PSK secrets. The key is identity, and the associated value is
// its secret.
std
::
map
<
StringRef
,
StringRef
>
psk_secrets
;
...
...
src/shrpx_ssl.cc
View file @
36dfc0a5
...
...
@@ -556,8 +556,8 @@ unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity_out,
auto
config
=
get_config
();
auto
&
tlsconf
=
config
->
tls
;
auto
&
identity
=
tlsconf
.
client
_
psk
.
identity
;
auto
&
secret
=
tlsconf
.
client
_
psk
.
secret
;
auto
&
identity
=
tlsconf
.
client
.
psk
.
identity
;
auto
&
secret
=
tlsconf
.
client
.
psk
.
secret
;
if
(
identity
.
empty
())
{
return
0
;
...
...
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