added: "assume_connection_is_through_ssl" config parameter

winix is testing an environment variable "HTTPS" for the value "on"
       to think that the connection is made via SSL
       you can set assume_connection_is_through_ssl to true for the winix
       to not testing any environment variables but just think the connection
       was made by https (useful when using proxy)
       default: false




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1069 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2018-01-01 00:14:02 +00:00
parent 5ab816b5be
commit 3eff400d88
4 changed files with 19 additions and 7 deletions

View File

@ -13,21 +13,21 @@ global_relative_working_dir := $(shell relative_path $(current_path) $(GLOBAL_WO
ifeq ($(CXX), g++)
CXX = g++-4.8
CXX = g++6
endif
ifndef CXX
ifeq ($(OSTYPE), FreeBSD)
CXX = clang++
else
CXX = g++-4.8
CXX = g++6
endif
endif
# CXX = g++-4.8
ifndef CXXFLAGS
CXXFLAGS = -Wall -O0 -g -fPIC -pthread -std=c++11 -I/usr/local/include -I/usr/include/postgresql -DEZC_USE_WINIX_LOGGER -DEZC_HAS_SPECIAL_STREAM
CXXFLAGS = -Wall -O0 -g -fPIC -pthread -std=c++17 -I/usr/local/include -I/usr/include/postgresql -DEZC_USE_WINIX_LOGGER -DEZC_HAS_SPECIAL_STREAM
endif
ifndef AR

View File

@ -808,6 +808,9 @@ void App::CheckSSL()
// value "on" exists in lighttpd server
// make sure that for other servers is "on" too
if( config.assume_connection_is_through_ssl )
cur.request->using_ssl = true;
else
if( EqualNoCase(cur.request->env_https.c_str(), L"on") )
cur.request->using_ssl = true;
}

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2016, Tomasz Sowa
* Copyright (c) 2008-2017, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -197,8 +197,9 @@ void Config::AssignValues(bool stdout_is_closed)
use_ssl = Bool(L"use_ssl", false);
use_ssl_static = Bool(L"use_ssl_static", false);
use_ssl_common = Bool(L"use_ssl_common", false);
use_ssl_only_for_logged_users = Bool(L"use_ssl_only_for_logged_users", true);
use_ssl_only_for_logged_users = Bool(L"use_ssl_only_for_logged_users", false);
use_ssl_redirect_code = Int(L"use_ssl_redirect_code", 303);
assume_connection_is_through_ssl = Bool(L"assume_connection_is_through_ssl", false);
base_url = Text(L"base_url");
base_url_static = Text(L"base_url_static");

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2016, Tomasz Sowa
* Copyright (c) 2008-2017, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -484,7 +484,7 @@ public:
// if SSL is enabled then if this is true the SSL will be used
// only for logged users
// default: true
// default: false
bool use_ssl_only_for_logged_users;
// if current connection is without SSL and should be made through SSL
@ -493,6 +493,14 @@ public:
// default: 303
int use_ssl_redirect_code;
// winix is testing an environment variable "HTTPS" for the value "on"
// to think that the connection is made via SSL
// you can set assume_connection_is_through_ssl to true for the winix
// to not testing any environment variables but just think the connection
// was made by https (useful when using proxy)
// default: false
bool assume_connection_is_through_ssl;
// when the HOST_HTTP environment variable is not equal to 'base_url'
// (the part 'http://' and the last slash is removed)
// the server will redirect into base_url + 'REQUEST_URI'