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
93ee9e30
Commit
93ee9e30
authored
Dec 13, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp, h2load: Use recommended ciphers and assign sane SSL_CTX options
parent
a84c319d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
src/Makefile.am
src/Makefile.am
+2
-1
src/h2load.cc
src/h2load.cc
+14
-0
src/nghttp.cc
src/nghttp.cc
+7
-0
No files found.
src/Makefile.am
View file @
93ee9e30
...
...
@@ -73,7 +73,8 @@ HTML_PARSER_OBJECTS += HtmlParser.cc
endif
# HAVE_LIBXML2
nghttp_SOURCES
=
${HELPER_OBJECTS}
${HELPER_HFILES}
nghttp.cc
\
${HTML_PARSER_OBJECTS}
${HTML_PARSER_HFILES}
${HTML_PARSER_OBJECTS}
${HTML_PARSER_HFILES}
\
ssl.cc ssl.h
nghttpd_SOURCES
=
${HELPER_OBJECTS}
${HELPER_HFILES}
nghttpd.cc
\
ssl.cc ssl.h
\
...
...
src/h2load.cc
View file @
93ee9e30
...
...
@@ -904,6 +904,20 @@ int main(int argc, char **argv) {
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
)
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
SSL_CTX_set_options
(
ssl_ctx
,
SSL_OP_ALL
|
SSL_OP_NO_SSLv2
|
SSL_OP_NO_SSLv3
|
SSL_OP_NO_COMPRESSION
|
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
);
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_AUTO_RETRY
);
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_RELEASE_BUFFERS
);
if
(
SSL_CTX_set_cipher_list
(
ssl_ctx
,
ssl
::
DEFAULT_CIPHER_LIST
)
==
0
)
{
std
::
cerr
<<
"SSL_CTX_set_cipher_list failed: "
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
)
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
SSL_CTX_set_next_proto_select_cb
(
ssl_ctx
,
client_select_next_proto_cb
,
nullptr
);
...
...
src/nghttp.cc
View file @
93ee9e30
...
...
@@ -75,6 +75,7 @@
#include "base64.h"
#include "http2.h"
#include "nghttp2_gzip.h"
#include "ssl.h"
#ifndef O_BINARY
#define O_BINARY (0)
...
...
@@ -1855,6 +1856,12 @@ int communicate(
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
);
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_AUTO_RETRY
);
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_RELEASE_BUFFERS
);
if
(
SSL_CTX_set_cipher_list
(
ssl_ctx
,
ssl
::
DEFAULT_CIPHER_LIST
)
==
0
)
{
std
::
cerr
<<
"[ERROR] "
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
)
<<
std
::
endl
;
result
=
-
1
;
goto
fin
;
}
if
(
!
config
.
keyfile
.
empty
())
{
if
(
SSL_CTX_use_PrivateKey_file
(
ssl_ctx
,
config
.
keyfile
.
c_str
(),
SSL_FILETYPE_PEM
)
!=
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