The BATCH feature is a form of a server-suggested message processing
delays.
To implement this, we can record all inflight batches, handle start/end
in handle_batch and collect all pending messages in the entrypoint of
the message handler as long as they have a correct batch id.
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
While this archive is indeed DER-formatted, in contrast to `cert_path`,
a regular DER file created from some certificate/key PEM file won't work:
```
openssl x509 -outform der -in foo.pem -out foo.der
```
This will result in the following OpenSSL error through tls-native error:
```
error:068000A8:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1188:
error:0688010A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1
error:crypto/asn1/tasn_dec.c:752:
error:0688010A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1
error:crypto/asn1/tasn_dec.c:685:Field=version, Type=PKCS12
```
Instead, a PKCS #12 archive must be created like so:
```
openssl pkcs12 -export -out foo.p12 -inkey fookey.pem -in foocert.pem
```
If the PEM file contains both the private key and the certificate,
the same file can be passed to `openssl` twice.
Also compare the documentation for `from_pkcs12` to `from_der` in
native-tls, as used in the `new_secured_transport` function:
https://docs.rs/native-tls/0.2.11/native_tls/struct.Identity.html#method.from_pkcs12
When `.to_string()` is invoked on a the crate-wide Error enum,
the error message using #[error("...")] is displayed.
Some of those wrapped internal enums also contain, possibly more
helpful, error messages. This will include the string gathered by
`.to_string()` from the encapsulated enum in the main error message.
See also
https://github.com/squidowl/halloy/pull/143
This patch adds an option to dangerously ignore all ceritificate
verifications. This option must be used with extreme caution and should
only be used as a last resort.
Closes#209, #230
Co-authored-by: Hyeon Kim <simnalamburt@gmail.com>
Some servers ignore PING commands until after login, so clients would
otherwise always time out, as mentioned in #207, #214, and #218.
With this change I am able to reliably connect to ircu servers.
This simplifies some of the `Config` structure, in particular this
means:
Parameters which are meaningfully equivalent longer stored in
an `Option<T>`, an example of this is `channels`. If you don't
want to join any channels you simply leave it as empty instead.
In effect, `None` is behaviorally equivalent to `vec![]`.
We don't allocate when accessing certain configuration options.
For example, when accessing `channels` we used to allocate a
vector to handle the "empty case", we simply return the slice
corresponding to the list of channels instead.
We skip serializing empty or optional configuration fields.
From a deserialization perspective this is already something
that was mostly supported through use of `Option<T>` and
`#[serde(default)]`.