Renamed many classes and feature to use "secure" term instead of "ssl". (note, the .ecf are still using the "ssl" terminologie).
Provided easy way to set secure settings for Standalone. For wsf launcher boolean option accept "true" or "yes" for True boolean, anything else is False.
This commit is contained in:
@@ -14,14 +14,14 @@ inherit
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_ssl_supported: BOOLEAN = False
|
||||
is_secure_connection_supported: BOOLEAN = False
|
||||
|
||||
feature -- Factory
|
||||
|
||||
new_socket (a_port: INTEGER; a_host: STRING): HTTP_STREAM_SOCKET
|
||||
do
|
||||
if is_tunneled then
|
||||
check ssl_supported: False end
|
||||
if is_secure then
|
||||
check is_secure_connection_supported: False end
|
||||
end
|
||||
create {HTTP_STREAM_SOCKET} Result.make_client_by_port (a_port, a_host)
|
||||
end
|
||||
|
||||
@@ -14,37 +14,37 @@ inherit
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_ssl_supported: BOOLEAN = True
|
||||
is_secure_connection_supported: BOOLEAN = True
|
||||
|
||||
feature -- Factory
|
||||
|
||||
new_socket (a_port: INTEGER; a_host: STRING): HTTP_STREAM_SOCKET
|
||||
local
|
||||
l_ssl: HTTP_STREAM_SSL_SOCKET
|
||||
l_secure: HTTP_STREAM_SECURE_SOCKET
|
||||
do
|
||||
if is_tunneled then
|
||||
create l_ssl.make_client_by_port (a_port, a_host)
|
||||
Result := l_ssl
|
||||
if attached ssl_protocol as l_prot then
|
||||
if is_secure then
|
||||
create l_secure.make_client_by_port (a_port, a_host)
|
||||
Result := l_secure
|
||||
if attached secure_protocol as l_prot then
|
||||
if l_prot.is_case_insensitive_equal ("ssl_2_3") then
|
||||
l_ssl.set_ssl_protocol_to_ssl_2_or_3
|
||||
l_secure.set_secure_protocol_to_ssl_2_or_3
|
||||
elseif l_prot.is_case_insensitive_equal ("tls_1_0") then
|
||||
l_ssl.set_ssl_protocol_to_tls_1_0
|
||||
l_secure.set_secure_protocol_to_tls_1_0
|
||||
elseif l_prot.is_case_insensitive_equal ("tls_1_1") then
|
||||
l_ssl.set_ssl_protocol_to_tls_1_1
|
||||
l_secure.set_secure_protocol_to_tls_1_1
|
||||
elseif l_prot.is_case_insensitive_equal ("tls_1_2") then
|
||||
l_ssl.set_ssl_protocol_to_tls_1_2
|
||||
l_secure.set_secure_protocol_to_tls_1_2
|
||||
elseif l_prot.is_case_insensitive_equal ("dtls_1_0") then
|
||||
l_ssl.set_ssl_protocol_to_dtls_1_0
|
||||
l_secure.set_secure_protocol_to_dtls_1_0
|
||||
else -- Default
|
||||
l_ssl.set_ssl_protocol_to_tls_1_2
|
||||
l_secure.set_secure_protocol_to_tls_1_2
|
||||
end
|
||||
end
|
||||
if attached ssl_key_file as k then
|
||||
l_ssl.set_key_file_path (k)
|
||||
if attached secure_certificate_file as c then
|
||||
l_secure.set_certificate_file_path (c)
|
||||
end
|
||||
if attached ssl_certificate_file as c then
|
||||
l_ssl.set_certificate_file_path (c)
|
||||
if attached secure_certificate_key_file as k then
|
||||
l_secure.set_key_file_path (k)
|
||||
end
|
||||
else
|
||||
create {HTTP_STREAM_SOCKET} Result.make_client_by_port (a_port, a_host)
|
||||
|
||||
@@ -11,7 +11,6 @@ deferred class
|
||||
WEB_SOCKET
|
||||
|
||||
inherit
|
||||
|
||||
WEB_SOCKET_CONSTANTS
|
||||
|
||||
feature -- Access
|
||||
@@ -37,7 +36,7 @@ feature -- Access
|
||||
-- Has the result fo protocol negotiation between client and the server
|
||||
-- By default it's an empty string.
|
||||
|
||||
is_tunneled: BOOLEAN
|
||||
is_secure: BOOLEAN
|
||||
-- Is the current connection tunneled over TLS/SSL?
|
||||
local
|
||||
l_uri: STRING
|
||||
|
||||
@@ -10,7 +10,6 @@ deferred class
|
||||
WEB_SOCKET_CLIENT_I
|
||||
|
||||
inherit
|
||||
|
||||
WEB_SOCKET_SUBSCRIBER
|
||||
redefine
|
||||
on_websocket_error,
|
||||
@@ -106,39 +105,39 @@ feature -- Access
|
||||
server_handshake: WEB_SOCKET_HANDSHAKE_DATA
|
||||
-- Handshake data received from the server
|
||||
|
||||
feature -- Access: ssl
|
||||
feature -- Access: secure
|
||||
|
||||
is_ssl_supported: BOOLEAN
|
||||
is_secure_connection_supported: BOOLEAN
|
||||
-- Is SSL supported?
|
||||
deferred
|
||||
end
|
||||
|
||||
ssl_protocol: detachable READABLE_STRING_GENERAL
|
||||
-- SSL protocol , if `is_ssl_supported'.
|
||||
secure_protocol: detachable READABLE_STRING_GENERAL
|
||||
-- SSL protocol , if `is_secure_connection_supported'.
|
||||
|
||||
ssl_certificate_file: detachable PATH
|
||||
-- SSL certificate file , if `is_ssl_supported'.
|
||||
secure_certificate_file: detachable PATH
|
||||
-- SSL certificate file , if `is_secure_connection_supported'.
|
||||
|
||||
ssl_key_file: detachable PATH
|
||||
-- SSL key file , if `is_ssl_supported'.
|
||||
secure_certificate_key_file: detachable PATH
|
||||
-- SSL key file , if `is_secure_connection_supported'.
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_ssl_protocol (a_prot: like ssl_protocol)
|
||||
set_secure_protocol (a_prot: like secure_protocol)
|
||||
do
|
||||
ssl_protocol := a_prot
|
||||
secure_protocol := a_prot
|
||||
end
|
||||
|
||||
set_ssl_certificate_file (p: detachable PATH)
|
||||
set_secure_certificate_file (p: detachable PATH)
|
||||
-- Set SSL certificate from file at `p'.
|
||||
do
|
||||
ssl_certificate_file := p
|
||||
secure_certificate_file := p
|
||||
end
|
||||
|
||||
set_ssl_key_file (p: detachable PATH)
|
||||
set_secure_certificate_key_file (p: detachable PATH)
|
||||
-- Set SSL key from file at `p'.
|
||||
do
|
||||
ssl_key_file := p
|
||||
secure_certificate_key_file := p
|
||||
end
|
||||
|
||||
feature -- Events API
|
||||
@@ -346,7 +345,7 @@ feature {NONE} -- Implementation
|
||||
|
||||
set_default_port
|
||||
do
|
||||
if is_tunneled then
|
||||
if is_secure then
|
||||
port := wss_port_default
|
||||
else
|
||||
port := ws_port_default
|
||||
|
||||
@@ -27,8 +27,8 @@ feature {NONE} -- Initialization
|
||||
create ready_state.make
|
||||
ensure
|
||||
uri_set: a_uri = uri
|
||||
port_wss: is_tunneled implies port = wss_port_default
|
||||
port_ws: not is_tunneled implies port = ws_port_default
|
||||
port_wss: is_secure implies port = wss_port_default
|
||||
port_ws: not is_secure implies port = ws_port_default
|
||||
ready_state_set: ready_state.state = {WEB_SOCKET_READY_STATE}.connecting
|
||||
subscriber_set: subscriber = a_subscriber
|
||||
protocol_set: protocol.is_empty
|
||||
@@ -58,8 +58,8 @@ feature {NONE} -- Initialization
|
||||
create ready_state.make
|
||||
ensure
|
||||
uri_set: a_uri = uri
|
||||
port_wss: is_tunneled implies port = wss_port_default
|
||||
port_ws: not is_tunneled implies port = ws_port_default
|
||||
port_wss: is_secure implies port = wss_port_default
|
||||
port_ws: not is_secure implies port = ws_port_default
|
||||
protocols_set: protocols = a_protocols
|
||||
ready_state_set: ready_state.state = {WEB_SOCKET_READY_STATE}.connecting
|
||||
subscriber_set: subscriber = a_subscriber
|
||||
@@ -214,7 +214,7 @@ feature {NONE} -- Implementation
|
||||
|
||||
set_default_port
|
||||
do
|
||||
if is_tunneled then
|
||||
if is_secure then
|
||||
port := wss_port_default
|
||||
else
|
||||
port := ws_port_default
|
||||
|
||||
Reference in New Issue
Block a user