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
770cfcaa
Commit
770cfcaa
authored
Nov 27, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libevent-server: Enable ECDHE ciphers
parent
04dae325
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
examples/libevent-server.c
examples/libevent-server.c
+10
-0
No files found.
examples/libevent-server.c
View file @
770cfcaa
...
...
@@ -95,6 +95,8 @@ static int next_proto_cb(SSL *s _U_, const unsigned char **data, unsigned int *l
static
SSL_CTX
*
create_ssl_ctx
(
const
char
*
key_file
,
const
char
*
cert_file
)
{
SSL_CTX
*
ssl_ctx
;
EC_KEY
*
ecdh
;
ssl_ctx
=
SSL_CTX_new
(
SSLv23_server_method
());
if
(
!
ssl_ctx
)
{
errx
(
1
,
"Could not create SSL/TLS context: %s"
,
...
...
@@ -104,6 +106,14 @@ static SSL_CTX* create_ssl_ctx(const char *key_file, const char *cert_file)
SSL_OP_ALL
|
SSL_OP_NO_SSLv2
|
SSL_OP_NO_COMPRESSION
|
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
);
ecdh
=
EC_KEY_new_by_curve_name
(
NID_X9_62_prime256v1
);
if
(
!
ecdh
)
{
errx
(
1
,
"EC_KEY_new_by_curv_name failed: %s"
,
ERR_error_string
(
ERR_get_error
(),
NULL
));
}
SSL_CTX_set_tmp_ecdh
(
ssl_ctx
,
ecdh
);
EC_KEY_free
(
ecdh
);
if
(
SSL_CTX_use_PrivateKey_file
(
ssl_ctx
,
key_file
,
SSL_FILETYPE_PEM
)
!=
1
)
{
errx
(
1
,
"Could not read private key file %s"
,
key_file
);
...
...
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