2019-09-24 06:52:34 -07:00
|
|
|
error @beta Efl.Net.Socket_Ssl_Error.HANDSHAKE = "Failed SSL handshake"; [[Failed SSL handshake]]
|
|
|
|
error @beta Efl.Net.Socket_Ssl_Error.CERTIFICATE_VERIFY_FAILED = "Failed to verify peer's certificate"; [[Failed to verify peer's certificate]]
|
2016-10-28 17:48:19 -07:00
|
|
|
|
2019-02-14 08:37:02 -08:00
|
|
|
class @beta Efl.Net.Socket_Ssl extends Efl.Loop_Consumer implements Efl.Net.Socket {
|
2016-10-28 17:48:19 -07:00
|
|
|
[[A wrapper socket doing SSL (Secure Sockets Layer).
|
|
|
|
|
2017-12-20 09:30:29 -08:00
|
|
|
Use this wrapper around an existing socket for secure
|
|
|
|
communication. One common use is to apply it to TCP sockets
|
2018-04-13 01:54:41 -07:00
|
|
|
created with @Efl.Net.Dialer_Tcp or @Efl.Net.Server_Tcp created
|
2016-10-28 17:48:19 -07:00
|
|
|
with "client,add" event.
|
|
|
|
]]
|
|
|
|
|
|
|
|
events {
|
efl: Add missing event types
Summary:
All events must have a type now, otherwise bindings don't know how to handle
the event_info field.
Most of the missing event types were actually "void" (no event_info present).
Some struct definitions had to be moved to eo instead of h files, so they
are available to bindings. Some have not, and are marked with FIXME.
Some namespaces have been fixed (like Efl_Event_Cb -> Efl.Event_Cb).
In general, there are hundreds of changed files, but mostly to add a type which
was not present before, so there's no harm done.
Also, A lot of FIXMEs have been added which should be, like, fixed.
For example, some events can send different types of event_info, which is
very inconvenient (and error prone).
Test Plan: make with c# bindings works, make check and make examples work too.
Reviewers: cedric, q66, lauromoura
Subscribers: zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6169
2018-05-11 08:20:40 -07:00
|
|
|
ssl,ready: void; [[Notifies the SSL handshake has been performed and the socket is now able to communicate]]
|
2018-04-13 01:58:29 -07:00
|
|
|
ssl,error: Eina.Error; [[An error such as @Efl.Net.Socket_Ssl_Error.HANDSHAKE]]
|
2016-10-28 17:48:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
methods {
|
|
|
|
adopt {
|
|
|
|
[[Adopt an Efl.Net.Dialer or regular Efl.Net.Socket that will be used for the actual communication.
|
|
|
|
|
|
|
|
If used with an Efl.Net.Dialer object, it will assume
|
|
|
|
the 'connect' role, otherwise will use 'accept'.
|
|
|
|
|
|
|
|
This is a constructor only method and should be called
|
|
|
|
before @Efl.Object.finalize.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
efl_net_socket: Efl.Net.Socket; [[The socket to adopt]]
|
|
|
|
ctx: Efl.Net.Ssl.Context; [[The SSL context to use when adopting the socket]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-08 12:57:04 -08:00
|
|
|
@property adopted @protected {
|
|
|
|
[[Return the adopted object, if any. Be careful!]]
|
|
|
|
get {
|
|
|
|
return: bool(false); [[$true if adopted, $false otherwise]]
|
|
|
|
}
|
|
|
|
values {
|
2019-09-10 07:05:44 -07:00
|
|
|
efl_net_socket: Efl.Net.Socket; [[The adopted object, if any, otherwise $NULL]]
|
|
|
|
ctx: Efl.Net.Ssl.Context; [[The SSL context used when adopting the socket, if any, otherwise $NULL]]
|
2016-12-08 12:57:04 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-28 17:48:19 -07:00
|
|
|
@property verify_mode {
|
|
|
|
[[How to verify the remote peer.]]
|
|
|
|
values {
|
2016-11-11 06:34:08 -08:00
|
|
|
verify_mode: Efl.Net.Ssl.Verify_Mode; [[Remote verification mode]]
|
2016-10-28 17:48:19 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@property hostname_verify {
|
|
|
|
[[Define if hostname should be verified.
|
|
|
|
|
|
|
|
This will check the socket hostname (without the port in
|
|
|
|
case of an IP) or the overriden value from
|
|
|
|
@.hostname_override.
|
|
|
|
]]
|
|
|
|
values {
|
2016-11-11 06:34:08 -08:00
|
|
|
hostname_verify: bool; [[$true if the hostname will be verified, $false otherwise]]
|
2016-10-28 17:48:19 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@property hostname_override {
|
|
|
|
[[Overrides the hostname to use for this socket.
|
|
|
|
|
|
|
|
Most of time this is useful if you're using an IP
|
|
|
|
address but the server certificate only specifies DNS
|
|
|
|
(names).
|
|
|
|
|
2019-09-10 07:05:44 -07:00
|
|
|
If $NULL, then it will fetch from socket using
|
2016-10-28 17:48:19 -07:00
|
|
|
@Efl.Net.Socket.address_remote or
|
|
|
|
@Efl.Net.Dialer.address_dial.
|
|
|
|
|
|
|
|
It's only used if @.hostname_verify is $true.
|
|
|
|
]]
|
|
|
|
values {
|
2019-05-21 07:01:07 -07:00
|
|
|
hostname_override: string; [[Hostname for this socket]]
|
2016-10-28 17:48:19 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.finalize;
|
2018-04-17 16:17:29 -07:00
|
|
|
Efl.Object.invalidate;
|
|
|
|
Efl.Object.destructor;
|
2016-10-28 17:48:19 -07:00
|
|
|
Efl.Io.Closer.close;
|
2016-12-27 07:58:07 -08:00
|
|
|
Efl.Io.Closer.closed { get; }
|
2017-01-11 07:35:03 -08:00
|
|
|
Efl.Io.Closer.close_on_exec { get; set; }
|
2018-04-17 16:17:29 -07:00
|
|
|
Efl.Io.Closer.close_on_invalidate { get; set; }
|
2016-10-28 17:48:19 -07:00
|
|
|
Efl.Io.Reader.read;
|
2017-01-11 07:35:03 -08:00
|
|
|
Efl.Io.Reader.can_read { get; set; }
|
|
|
|
Efl.Io.Reader.eos { get; set; }
|
2016-10-28 17:48:19 -07:00
|
|
|
Efl.Io.Writer.write;
|
2017-01-11 07:35:03 -08:00
|
|
|
Efl.Io.Writer.can_write { get; set; }
|
2016-12-27 07:58:07 -08:00
|
|
|
Efl.Net.Socket.address_remote { get; }
|
|
|
|
Efl.Net.Socket.address_local { get; }
|
2016-10-28 17:48:19 -07:00
|
|
|
}
|
|
|
|
}
|