Update HTTP Client cURL implementation:
Added the option to set cipher list used to negotiate security settings (SSL handshake)
This commit is contained in:
@@ -272,6 +272,15 @@ feature -- Authentication
|
|||||||
-- Associated optional credentials value.
|
-- Associated optional credentials value.
|
||||||
-- Computed as `username':`password'.
|
-- Computed as `username':`password'.
|
||||||
|
|
||||||
|
cipher_list: detachable READABLE_STRING_32
|
||||||
|
-- SSL cipher preference lists
|
||||||
|
-- examples: DEFAULT, ALL, TLSv1
|
||||||
|
-- check https://www.openssl.org/docs/man1.1.0/apps/ciphers.html
|
||||||
|
--! At the moment only used for LIB_CURL_HTTP_CLIENT
|
||||||
|
--! Net implementation set all the ciphers using the OpenSSL at
|
||||||
|
--! initialization time.
|
||||||
|
|
||||||
|
|
||||||
feature -- Status setting
|
feature -- Status setting
|
||||||
|
|
||||||
set_is_debug (b: BOOLEAN)
|
set_is_debug (b: BOOLEAN)
|
||||||
@@ -401,6 +410,13 @@ feature -- Element change
|
|||||||
chunk_size := a_size
|
chunk_size := a_size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_cipher_list (a_list: READABLE_STRING_GENERAL)
|
||||||
|
do
|
||||||
|
create {STRING_32} cipher_list.make_from_string_general (a_list)
|
||||||
|
ensure
|
||||||
|
cipher_list_set: attached cipher_list as c_list and then c_list.same_string_general (a_list)
|
||||||
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -372,6 +372,11 @@ feature -- Execution
|
|||||||
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_ssl_verifypeer, 0)
|
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_ssl_verifypeer, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--| Cipher List
|
||||||
|
if attached session.cipher_list as c_list then
|
||||||
|
curl_easy.setopt_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_ssl_cipher_list, c_list )
|
||||||
|
end
|
||||||
|
|
||||||
--| Request method
|
--| Request method
|
||||||
if request_method.is_case_insensitive_equal ("GET") then
|
if request_method.is_case_insensitive_equal ("GET") then
|
||||||
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_httpget, 1)
|
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_httpget, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user