|
Symbian platform (C++)
SDK native APIs, runtime and tooling
|
Worker-owned TLS transport for outbound HTTP and inbound sessions. More...
#include <cpp/symbian/api/include/symbian/api/connectivity/tls_stream.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| TlsStream (TlsStream &&other) noexcept | |
| TlsStream & | operator= (TlsStream &&other) noexcept |
| TlsStream (const TlsStream &)=delete | |
| TlsStream & | operator= (const TlsStream &)=delete |
| ~TlsStream () | |
| absl::Status | SetAlpnProtocol (std::string_view protocol) |
| Select the sole server ALPN protocol before Accept. | |
| std::string_view | negotiated_version () const |
| std::string_view | negotiated_protocol () const |
| void | Close () override |
| absl::Status | Accept (TcpClient &&client, absl::Time deadline=absl::InfiniteFuture()) |
| Complete TLS 1.2/1.3 handshake by an absolute deadline. | |
| absl::StatusOr< std::size_t > | Read (std::span< std::uint8_t > bytes, absl::Time deadline=absl::InfiniteFuture()) override |
| Receive application data into at most 32 KiB. | |
| absl::Status | Write (std::span< const std::uint8_t > bytes, absl::Time deadline=absl::InfiniteFuture()) override |
| Send at most 32 KiB of application data. | |
| void | CloseSession () |
| Close the current stream and reset its TLS state. | |
| bool | connected () const |
Public Member Functions inherited from symbian::net::ByteStream | |
| virtual | ~ByteStream ()=default |
Static Public Member Functions | |
| static absl::StatusOr< TlsStream > | Create (std::string_view server_certificate, std::string_view server_private_key, std::string_view client_ca_bundle, TlsVersion version) |
| Configure identity, trust roots and one TLS protocol version. | |
| static absl::StatusOr< TlsStream > | Connect (TcpClient client, std::string_view hostname, std::string_view ca_bundle, TlsVersion version, std::string_view alpn="http/1.1", absl::Time deadline=absl::InfiniteFuture()) |
| Authenticate an outbound peer using explicit roots and hostname. | |
Worker-owned TLS transport for outbound HTTP and inbound sessions.
Connect verifies the server certificate chain and hostname, sends SNI and negotiates one selected ALPN protocol. Create/Accept configure an inbound server that requires a verified client certificate. Both paths share the same Mbed TLS state, entropy, native socket BIO and deadline handling. The caller supplies PEM roots/identities and an accepted hardware entropy adapter; the SDK supplies no default roots or identity.
Read returns zero only for authenticated close_notify; a bare transport EOF is a truncation error. Read/Write cancel and drain native socket requests on deadline. Calls and destruction stay on the socket's owning worker, outside active scheduler callbacks. CloseSession cancels by closing the socket, without a blocking close alert. Inbound state may then Accept another peer.
|
noexcept |
|
delete |
| symbian::api::connectivity::TlsStream::~TlsStream | ( | ) |
| absl::Status symbian::api::connectivity::TlsStream::Accept | ( | TcpClient && | client, |
| absl::Time | deadline = absl::InfiniteFuture() |
||
| ) |
Complete TLS 1.2/1.3 handshake by an absolute deadline.
|
inlineoverridevirtual |
Implements symbian::net::ByteStream.
| void symbian::api::connectivity::TlsStream::CloseSession | ( | ) |
Close the current stream and reset its TLS state.
|
static |
Authenticate an outbound peer using explicit roots and hostname.
Select one protocol version and ALPN protocol. No verification bypass or system trust store is provided. Uses the same native BIO as server Accept.
| bool symbian::api::connectivity::TlsStream::connected | ( | ) | const |
|
static |
Configure identity, trust roots and one TLS protocol version.
The vendored Mbed TLS server cannot negotiate a hybrid 1.2/1.3 profile. Select the version explicitly; both are authenticated by the same policy.
| std::string_view symbian::api::connectivity::TlsStream::negotiated_protocol | ( | ) | const |
| std::string_view symbian::api::connectivity::TlsStream::negotiated_version | ( | ) | const |
|
overridevirtual |
Receive application data into at most 32 KiB.
Implements symbian::net::ByteStream.
| absl::Status symbian::api::connectivity::TlsStream::SetAlpnProtocol | ( | std::string_view | protocol | ) |
Select the sole server ALPN protocol before Accept.
|
overridevirtual |
Send at most 32 KiB of application data.
Implements symbian::net::ByteStream.