Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
0f159547
Commit
0f159547
authored
Sep 20, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip SSL init if PEM file is not specified
parent
167338f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
mongoose.c
mongoose.c
+7
-2
No files found.
mongoose.c
View file @
0f159547
...
...
@@ -4101,7 +4101,12 @@ static int load_dll(struct mg_context *ctx, const char *dll_name,
// Dynamically load SSL library. Set up ctx->ssl_ctx pointer.
static
int
set_ssl_option
(
struct
mg_context
*
ctx
)
{
int
i
,
size
;
const
char
*
pem
=
ctx
->
config
[
SSL_CERTIFICATE
];
const
char
*
pem
;
// If PEM file is not specified, skip SSL initialization.
if
((
pem
=
ctx
->
config
[
SSL_CERTIFICATE
])
==
NULL
)
{
return
1
;
}
#if !defined(NO_SSL_DL)
if
(
!
load_dll
(
ctx
,
SSL_LIB
,
ssl_sw
)
||
...
...
@@ -4125,7 +4130,7 @@ static int set_ssl_option(struct mg_context *ctx) {
// If user callback returned non-NULL, that means that user callback has
// set up certificate itself. In this case, skip sertificate setting.
if
(
call_user
(
fc
(
ctx
),
MG_INIT_SSL
)
==
NULL
&&
pem
!=
NULL
&&
if
(
call_user
(
fc
(
ctx
),
MG_INIT_SSL
)
==
NULL
&&
(
SSL_CTX_use_certificate_file
(
ctx
->
ssl_ctx
,
pem
,
SSL_FILETYPE_PEM
)
==
0
||
SSL_CTX_use_PrivateKey_file
(
ctx
->
ssl_ctx
,
pem
,
SSL_FILETYPE_PEM
)
==
0
))
{
cry
(
fc
(
ctx
),
"%s: cannot open %s: %s"
,
__func__
,
pem
,
ssl_error
());
...
...
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