Explorar o código

Merge pull request #200 from ejohnstown/master

Allow no SSL_CERTIFICATE when using init_ssl callback.
Sergey Lyubka %!s(int64=12) %!d(string=hai) anos
pai
achega
de7745370c
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      mongoose.c

+ 4 - 2
mongoose.c

@@ -4741,8 +4741,10 @@ static int set_ssl_option(struct mg_context *ctx) {
   int i, size;
   int i, size;
   const char *pem;
   const char *pem;
 
 
-  // If PEM file is not specified, skip SSL initialization.
-  if ((pem = ctx->config[SSL_CERTIFICATE]) == NULL) {
+  // If PEM file is not specified and the init_ssl callback
+  // is not specified, skip SSL initialization.
+  if ((pem = ctx->config[SSL_CERTIFICATE]) == NULL &&
+      ctx->callbacks.init_ssl == NULL) {
     return 1;
     return 1;
   }
   }