|  | @@ -14654,7 +14654,7 @@ init_ssl_ctx(struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 | 
	
		
			
				|  |  |  	const char *chain;
 | 
	
		
			
				|  |  |  	char ebuf[128];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	if (!phys_ctx || !dom_ctx) {
 | 
	
		
			
				|  |  | +	if (!phys_ctx) {
 | 
	
		
			
				|  |  |  		return 0;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -14663,6 +14663,10 @@ init_ssl_ctx(struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 | 
	
		
			
				|  |  |  		return 1;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	if (!dom_ctx) {
 | 
	
		
			
				|  |  | +		dom_ctx = &(phys_ctx->dd);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	/* Check for external SSL_CTX */
 | 
	
		
			
				|  |  |  	callback_ret =
 | 
	
		
			
				|  |  |  	    (phys_ctx->callbacks.external_ssl_ctx == NULL)
 |