Skip to content

Commit f104f9f

Browse files
authored
feat: complete handshake using rustls when calling &tcpa on a tls listener (#773)
* complete handshake using rustls when calling &tcpa on a tls listener * update changelog
1 parent e095cca commit f104f9f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This version is not yet released. If you are reading this on the website, then t
3131
- Remove the `ⁿ%:1` ("root" pattern) optimization, it undered incorrectly, and should be replaced with [`anti ⌝`](https://uiua.org/docs/anti)[`pow ⁿ`](https://uiua.org/docs/power)
3232
- Add [`&seek`](https://uiua.org/docs/&seek) function for working with large files
3333
- Remove previously deprecated `signature` and `stringify` modifiers
34+
- Calling [`&tcpa`](https://uius.org/docs/&tcpa) on a TLS listener created with [`&tlsl`](https://uiua.org/docs/&tlsl) now automatically tries conducting a TSL handshake
3435
### Interpreter
3536
- The fomatter no longer truncates trailing decimal `0`s from number literals
3637
- Implement filled adjacent [`stencil ⧈`](https://uiua.org/docs/stencil)

src/sys/native.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,10 @@ impl SysBackend for NativeSys {
876876
#[cfg(feature = "tls")]
877877
{
878878
if let Some(listener) = NATIVE_SYS.tls_listeners.get_mut(&handle) {
879-
let (stream, _) = listener.listener.accept().map_err(|e| e.to_string())?;
880-
let conn = rustls::ServerConnection::new(listener.config.clone())
879+
let (mut stream, _) = listener.listener.accept().map_err(|e| e.to_string())?;
880+
let mut conn = rustls::ServerConnection::new(listener.config.clone())
881881
.map_err(|e| e.to_string())?;
882+
let _ = conn.complete_io(&mut stream).map_err(|e| e.to_string())?;
882883
let handle = NATIVE_SYS.new_handle();
883884
NATIVE_SYS.tls_sockets.insert(
884885
handle,

0 commit comments

Comments
 (0)