From 19eb5113e9483d0c7b4fde0917e767ed555ae45e Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 30 Nov 2016 10:43:09 +0100 Subject: [PATCH] Added ssl files to allow cms SSL support (disabled by default). Fixed typo in auth post password message. Make sure to keep site_destination set in login form, so that the user is redirected to previous location. Use default http client in the feel aggregator component, instead of forcing libcurl usage. --- .gitignore | 2 ++ examples/demo/demo-safe.ecf | 6 ++++++ examples/demo/demo.crt | 15 +++++++++++++++ examples/demo/demo.ini | 8 +++++++- examples/demo/demo.key | 15 +++++++++++++++ .../auth/templates/block_post_password.tpl | 2 +- .../modules/basic_auth/templates/block_login.tpl | 1 + .../modules/custom_block/config/custom_block.json | 1 + .../session_auth/templates/block_login.tpl | 1 + .../src/util/http_client_helper.e | 4 ++-- modules/feed_aggregator/feed_aggregator_api.e | 4 ++-- 11 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 examples/demo/demo.crt create mode 100644 examples/demo/demo.key diff --git a/.gitignore b/.gitignore index 932c7cf..ac71b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ EIFGENs *.rc *.bak *.sqlite +.*.swo Thumbs.db +*.dll diff --git a/examples/demo/demo-safe.ecf b/examples/demo/demo-safe.ecf index a781967..ca2e3a2 100644 --- a/examples/demo/demo-safe.ecf +++ b/examples/demo/demo-safe.ecf @@ -71,6 +71,12 @@ + + + + + + diff --git a/examples/demo/demo.crt b/examples/demo/demo.crt new file mode 100644 index 0000000..6147c20 --- /dev/null +++ b/examples/demo/demo.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICWDCCAcGgAwIBAgIJAJnXGtV+PtiYMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMTUwNDAzMjIxNTA0WhcNMTYwNDAyMjIxNTA0WjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQDFMK6ojzg+KlklhTossR13c51izMgGc3B0z9ttfHIcx2kxra3HtHcKIl5wSUvn +G8zmSyFAyQTs5LUv65q46FM9qU8tP+vTeFCfNXvjRcIEpouta3J53K0xuUlxz4d4 +4D6qvdDWAez/0AkI4y5etW5zXtg7IQorJhsI9TmfGuruzwIDAQABo1AwTjAdBgNV +HQ4EFgQUbWpk2HoHa0YqpEwr7CGEatBFTMkwHwYDVR0jBBgwFoAUbWpk2HoHa0Yq +pEwr7CGEatBFTMkwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAi+h4/ +IgEocWkdRZBKHEcTrRxz5WhEDJMoVo9LhnXvCfn1G/4p6Un6sYv7Xzpi9NuSY8uV +cjfJJXhtF3AtyZ70iTAxWaRWjGaZ03PYOjlledJ5rqJEt6CCn8m+JsfznduZvbxQ +zQ6jCLXfyD/tvemB+yYEI3NntvRKx5/zt6Q26Q== +-----END CERTIFICATE----- diff --git a/examples/demo/demo.ini b/examples/demo/demo.ini index 2498319..8c631dc 100644 --- a/examples/demo/demo.ini +++ b/examples/demo/demo.ini @@ -1,3 +1,9 @@ port=9090 #port=12345 -#verbose=true +verbose=true +socket_timeout=60 +socket_recv_timeout=45 +keep_alive_timeout=25 +ssl_enabled=false +ssl_ca_key=demo.key +ssl_ca_crt=demo.crt diff --git a/examples/demo/demo.key b/examples/demo/demo.key new file mode 100644 index 0000000..e5e22a5 --- /dev/null +++ b/examples/demo/demo.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDFMK6ojzg+KlklhTossR13c51izMgGc3B0z9ttfHIcx2kxra3H +tHcKIl5wSUvnG8zmSyFAyQTs5LUv65q46FM9qU8tP+vTeFCfNXvjRcIEpouta3J5 +3K0xuUlxz4d44D6qvdDWAez/0AkI4y5etW5zXtg7IQorJhsI9TmfGuruzwIDAQAB +AoGAR5efMg+dieRyLU8rieJcImxVbfOPg9gRsjdtIVkXTR+RL7ow59q7hXBo/Td/ +WU8cm1gXoJ/bK+71YYqWyB+BaLRIWvRWb7Gdw203tu4e136Ca5uuY+71qdbVTVcl +NQ7J+T+eAQFP+a+DdT3ZQxu9eze87SMbu6i5YSpIk2kusOECQQDunv/DQ+nc+NgR +DF+Td3sNYUVRT9a1CWi6abAG6reXwp8MS4NobWDf+Ps4JODhEEwlIdq5qL7qqYBZ +Gc1TJJ53AkEA0404Fn6vAzzegBcS4RLlYTK7nMr0m4pMmDMCI6YzAYdMmKHp1e6f +IwxSmQrmwyAgwcT01bc0+A8yipcC2BWQaQJBAJ01QZm635OGmos41KsKF5bsE8gL +SpBBH69Yu/ECqGwie7iU84FUNnO4zIHjwghlPVVlZX3Vz9o4S+fn2N9DC+cCQGyZ +QyCxGdC0r5fbwHJQS/ZQn+UGfvlVzqoXDVMVn3t6ZES6YZrT61eHnOM5qGqklIxE +Old3vDZXPt/MU8Zvk3kCQBOgUx2VxvTrHN37hk9/QIDiM62+RenBm1M3ah8xTosf +1mSeEb6d9Kwb3TgPBmA7YXzJuAQfRIvEPMPxT5SSr6Q= +-----END RSA PRIVATE KEY----- diff --git a/examples/demo/site/modules/auth/templates/block_post_password.tpl b/examples/demo/site/modules/auth/templates/block_post_password.tpl index 0ec7a7c..0058965 100644 --- a/examples/demo/site/modules/auth/templates/block_post_password.tpl +++ b/examples/demo/site/modules/auth/templates/block_post_password.tpl @@ -1,3 +1,3 @@
-

We have send you a new token code, check your email to generate a new password

+

We have sent you a new token code, check your email to generate a new password

diff --git a/examples/demo/site/modules/basic_auth/templates/block_login.tpl b/examples/demo/site/modules/basic_auth/templates/block_login.tpl index eb3fccf..1b9631d 100644 --- a/examples/demo/site/modules/basic_auth/templates/block_login.tpl +++ b/examples/demo/site/modules/basic_auth/templates/block_login.tpl @@ -4,6 +4,7 @@

Login or Register

+ {unless isempty="$site_destination"}{/unless}
diff --git a/examples/demo/site/modules/custom_block/config/custom_block.json b/examples/demo/site/modules/custom_block/config/custom_block.json index f18b9ac..ec20f4b 100644 --- a/examples/demo/site/modules/custom_block/config/custom_block.json +++ b/examples/demo/site/modules/custom_block/config/custom_block.json @@ -2,6 +2,7 @@ "blocks": { "test": { "title": "Custom block test", + "is_raw": "yes", "region": "footer", "weight": 100, "conditions": ["path:demo/*"] diff --git a/examples/demo/site/modules/session_auth/templates/block_login.tpl b/examples/demo/site/modules/session_auth/templates/block_login.tpl index 4243ff8..791caa6 100644 --- a/examples/demo/site/modules/session_auth/templates/block_login.tpl +++ b/examples/demo/site/modules/session_auth/templates/block_login.tpl @@ -4,6 +4,7 @@

Login or Register

+ {unless isempty="$site_destination"}{/unless}
diff --git a/library/http_client_extension/src/util/http_client_helper.e b/library/http_client_extension/src/util/http_client_helper.e index f120da2..300875f 100644 --- a/library/http_client_extension/src/util/http_client_helper.e +++ b/library/http_client_extension/src/util/http_client_helper.e @@ -12,10 +12,10 @@ feature -- Access get_http_session local - h: LIBCURL_HTTP_CLIENT + h: DEFAULT_HTTP_CLIENT b: like base_url do - create h.make + create h b := base_url if b = Void then b := "" diff --git a/modules/feed_aggregator/feed_aggregator_api.e b/modules/feed_aggregator/feed_aggregator_api.e index a5166c4..bc97be0 100644 --- a/modules/feed_aggregator/feed_aggregator_api.e +++ b/modules/feed_aggregator/feed_aggregator_api.e @@ -143,9 +143,9 @@ feature -- Operation new_http_client_session (a_url: READABLE_STRING_8): HTTP_CLIENT_SESSION local - cl: LIBCURL_HTTP_CLIENT + cl: DEFAULT_HTTP_CLIENT do - create cl.make + create cl Result := cl.new_session (a_url) Result.set_is_insecure (True) end